Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

在我机子上试验了好多次都行,为什么不能被AC呢?请高手指点。

Posted by clearriver at 2006-07-31 14:17:09 on Problem 1007
#include<iostream.h>
#include<string.h>
#include<stdio.h>
void main()
{int m,n,t;
int a[100]={0};
cin>>m>>n;
int i;
char s[100][51]={0};
char s0[100];
for(i=0;i<m;i++)
{
//scanf("%s\n",s[i]);
cin>>s[i];
for(int j=0;j<n;j++)
{
for(int b=j+1;b<n;b++)
{if(s[i][j]<s[i][b])
a[i]++;
}
}
}
for(i=0;i<m-1;i++)
for(int j=0;j<m-i-1;j++)
if(a[j]<a[j+1])
{t=a[j];
a[j]=a[j+1];
a[j+1]=t;
strcpy(s0,s[j]);
strcpy(s[j],s[j+1]);
strcpy(s[j+1],s0);
}
for(i=0;i<=m-1;i++)
cout<<s[i]<<endl;
//for(i=0;i<m;i++)
//cout<<a[i]<<endl;}
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator