No older revisions available
No older revisions available
~cpp #include <fstream> #include <iostream> using namespace std; int main() { ifstream fin("UnsortedData.txt"); ofstream fout("output.txt"); int ar[10000]; int x; for(int i=0;i<10000;i++) { int tem; fin >> tem; ar[i] = tem; } for(int j=0;j<10000;j++) { for (int k = 0 ; k < 10000 ; k++) { if(ar[j]<ar[k]) { x=ar[j]; ar[j]=ar[k]; ar[k]=x; } } } for (int p = 0 ; p<=10000 ; p++) { fout << ar[p]<<endl; } return 0; }