24

Document Sample
24 Powered By Docstoc
					#include<fstream.h> void main() {ifstream f("nr.in"); long int x,a[11],k=0,b[11]; int nr[11],i,j; for(i=0;i<=10;i++)nr[i]=0; while(f>>x){a[k]=x; k+=1;} for(i=0;i<k-1;i++) for(j=i+1;j<k;j++){ if(a[i]>a[j]) nr[i]++; else nr[j]++;} for(i=0;i<k;i++)b[nr[i]]=a[i]; for(i=0;i<k;i++)a[i]=b[i]; ofstream fo("nr.out"); for(i=0;i<k;i++)fo<<a[i]<<" "; }


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:32
posted:10/30/2008
language:English
pages:1