|
|
back to boardBBBBBBBBUG!!! Posted by vagrant 22 Oct 2010 22:10 #include<iostream> using namespace std; void main() { int n,i=0,t,a[102]={-1}; cin>>n; int num[1020]={-1}; for(int j=1;j<=n;j++) { do { i++; cin>>num[i]; }while(num[i]!=0); t=num[1]; num[1]=0; for(int m=2;m<i;m++) { if(t<num[m]) t=num[m]; num[m]=0; } a[j]=t; } for(int j=1;j<=n;j++) { t=j; for(int m=1;m<=n;m++) { if(a[t]<a[m]) t=m; } cout<<t<<" "; a[t]=-1; } } AAAAACCEPTED!!!!! WHY? |
|
|