| ||||||||||
| 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 | |||||||||
我用字符串长度算的,没有判断(附程序)In Reply To:Re:这么简单的题都WA,实在是郁闷,给一组bt的数据吧 Posted by:hz02ruc at 2004-08-08 21:50:58 #include<stdio.h>
#include<string.h>
int main()
{
char arry[26];
int n,i,clj[15],min,sum;
while(scanf("%d",&n)!=EOF&&n!=0)
{
for(i=0;i<n;i++)
clj[i]=0;
min=100;
for(i=0;i<n;i++)
{
scanf("%s",arry);
clj[i]+=strlen(arry);
if(clj[i]!=25)
{
scanf("%s",arry);
clj[i]+=strlen(arry);
}
clj[i]=25-clj[i];
if(clj[i]<min)
min=clj[i];
}
sum=0;
for(i=0;i<n;i++)
sum+=clj[i]-min;
printf("%d\n",sum);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator