Answers for "turbo sort codechef solution"

C++
0

turbo sort codechef solution

#include <iostream>
#include <algorithm>
using namespace std;

int main() {
	// your code goes here
	int number;
	cin >> number; //input no. of elements
	int arr[number]; //defining array with size of no. of elements
	for (int i = 0; i < number; i++) { //Loop to insert values into array
	    cin >> arr[i]; 
	}
	sort(arr,arr+number); //in-built sort function to sort array in ascending order
	for(int i=0;i<number;i++){ //Loop to output elements of array
	    cout<<arr[i]<<"\n";
	}   
	return 0;
}
Posted by: Guest on April-06-2021

Browse Popular Code Answers by Language