| ||||||||||
| 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 | |||||||||
请高手帮忙看我做的1007题的程序代码错在哪里#include"stdio.h"
void main()
{
int i, j, k, line, string, s[100] = {0}, lgest;
char a[100][51] = {'\0'}, t;
scanf("%d%d", &string, &line);
getchar();
for(i = 0; i < line; i++)
scanf("%s", &a[i]);
for(i = 0; i < line; i++)
for(j = 0; j < (string - 1); j++)
for(k = j+1; k < string; k++)
if(a[i][j] > a[i][k])
s[i]++;
for(i = 0; i < line; i++)
{
t = 'z';
for(j = 0; j < line; j++)
if(t > s[j])
{
lgest = j;
t = s[j];
}
printf("%s\n", a[lgest]);
s[lgest] = 'z';
}
}
输入了Sample input
得到了正确的Sample output
可代码就是过不了!请帮忙!感激感激!
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator