#include<stdio.h> #include<string.h> int main() { //freopen("input.txt","r",stdin); int n; while(scanf("%d\n",&n)==1&&n!=0) { char array[n+1][26]; int i=0,j,k,l,m=n,min=25,space[n+1]; for(i=0;i<n;i++) { gets(array[i]); int count=0; for(j=0;j<strlen(array[i]);j++) { if(array[i][j]==' ')count++; } space[i]=count; if(count<min)min=count; } int sum=0; for(i=0;i<m;i++) { sum=sum+(space[i]-min); } printf("%d\n",sum); } return 0; }
No comments:
Post a Comment