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 |
为何我不能AC。。求助#include<stdio.h> #include<stdlib.h> int main() { char a[101][51]; int i,j,n,m,k,max=0,x; scanf("%d%d",&i,&j); int b[j]; fflush(stdin); for(m=0;m<j;m++) { fflush(stdin); for(n=0;n<i;n++) { scanf("%c",&a[m][n]); } b[m]=0; } for(m=0;m<j;m++) { x=0; for(n=0;n<i-1;n++) { for(k=n+1;k<i;k++) { if(a[m][n]>a[m][k]) { x++; } if(max<x) { max=x; } } } b[m]=x; } for(k=0;k<=max;k++) { for(m=0;m<j;m++) { if(b[m]==k) { for(n=0;n<i;n++) { printf("%c",a[m][n]); } 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