| ||||||||||
| 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:可是我找不出这方面的问题啊,附上原代码,帮我看一下In Reply To:多看看FAQ Posted by:TN at 2005-06-04 10:43:30 #include <iostream.h>
void main()
{
char num[200][200];
int number[200];
int M,N,maxIndex,j,m,n,i;
cin>>N>>M;
for(i=0;i<M;i++)
for(j=0;j<N;j++)
cin>>num[i][j];
for(i=0;i<M;i++)
{
number[i]=0;
for( m=0;m<N;m++)
for(j=m;j<N;j++)
if(num[i][m]>num[i][j])number[i]++;
}
for(i=0;i<M;i++)
{
maxIndex=i;
for(j=0;j<M;j++)
if(number[j]<number[maxIndex])
maxIndex=j;
for(n=0;n<N;n++)
cout<<num[maxIndex][n];
cout<<endl;
number[maxIndex]=1000;
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator