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 |
为什么我的过不了……郁闷死了,因为初学#include<stdio.h> char str[100][50]; void main() { char (*p)[50]; long M,m; int i,j,k,volom,row; long int a[100]={0}; scanf("%d %d",&volom,&row); p=str; for(i=0;i<row;i++) scanf("%s",str[i]); for(i=0;i<row;i++) for(k=0;k<volom-1;k++) for(j=k+1;j<volom;j++) if(*(*(p+i)+k)>*(*(p+i)+j)) a[i]+=1; M=50000; for(m=0;m<M;m++) for(i=0;i<row;i++) if(a[i]<m) { printf("%s\n",(p+i)); a[i]=M; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator