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 |
我在vc上运行的时候明明答案是正确的,但传到这边就说答案出错,请高人指点#include<stdio.h> char a[101][51]; int b[101][51],i,j; int main () { int k,l,m,n; scanf("%d %d",&i,&j); getchar(); for(l=1;l<=j;l++) { for(k=1;k<=i;k++) { a[l][k]=getchar(); for(m=1;m<k;m++) { if(a[l][m]>a[l][k]) { b[l][m]++; }; }; }; getchar(); }; for(l=1;l<=j;l++) { for(k=1;k<=i;k++) { b[l][0]+=b[l][k]; }; }; b[0][1]=1; for(l=2;l<=j;l++) { b[0][l]=l; for(k=l-1;k>=0;k--) { n=b[0][k]; if(b[n][0]>b[l][0]) {} else { k++; for(n=l;n>=k+1;n--) { b[0][n]=b[0][n-1]; }; b[0][k]=l; break; }; }; }; for(l=1;l<=j;l++) { m=b[0][l]; for(k=1;k<=i;k++) { putchar(a[m][k]); }; printf("\n"); }; return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator