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 |
为什么WA???#include <stdio.h> int main() { char a[20][25]; int n,i,j,min,sum,count[10]; scanf("%d",&n); getchar(); while(n) { for (i=0;i<10;i++) { count[i]=0; } min=100; sum=0; for (i=0;i<n;i++) { for (j=0;j<25;j++) { scanf("%c",&a[i][j]); } getchar(); } for (i=0;i<n;i++) { for (j=0;j<25;j++) { if (a[i][j]==' ') { count[i]++; } } } for (i=0;i<n;i++) { if (min>count[i]) { min=count[i]; } } for(i=0;i<n;i++) { sum=sum+count[i]-min; } printf("%d\n",sum); scanf("%d",&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