Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:1007In Reply To:1007 Posted by:charming at 2006-11-25 18:24:59 > 帮忙看一下有什么问题#include<iostream.h> > #include<string> > void main() > { > > int i,j,k,p; > int num1,num2,min; > char x[10][10]; > int t[10],a[10]={0}; > cin>>num1>>num2; > for(i=0;i<num2;i++) > { > cin>>x[i]; > } > for(i=0;i<num2;i++) > { > t[i]=0; > for(j=0;j<num1;j++) > for(k=j+1;k<num1;k++) > if(x[i][j]>x[i][k]) > { > t[i]++; > } > > } > > > for(i=0;i<num2;i++) > { > min=60; > for(j=0;j<num2;j++) > if(a[j]==0) > if(min>t[j]) > { > min=t[j]; > k=j; > } > a[k]=1; > for(p=0;p<num1;p++) > cout<<x[k][p]; > cout<<endl; > } > > > > > > > } > Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator