#include <iostream>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
int test;
char word[26];
int sum,space;
int max1 = 100;
int minlne;
int main()
{
while((cin>>test)&&test)
{
minlne=30;
sum =0;
getchar();//此处加getchar()可以解决输入问题相当于加一个缓冲区
for(int j=0; j<test; j++)
{
//scanf("%s",word);
//cin.getline(word,25);
gets(word);
//
int counter =0;
for(int i=0; i<25; i++)
{
if(word[i]==' ')
counter++;
}
sum = sum+counter;
//cout<<sum<<"--"<<counter<<"--";
if(minlne >counter)
minlne = counter;
}
//cout<<sum<<"sum"<<endl;
cout<<sum-minlne*test<<endl;
// system("pause");
}
return 0;
}
poj1166
最新推荐文章于 2021-07-27 10:26:26 发布