| ||||||||||
| 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>
#include<string.h>
int main()
{
char unit[10],name1[50][20],name[20];
float propotion,befo,ori;//实际占的比例和原本有的
int i=0,j,flag=0;
memset(name1,0,sizeof(name1[0]));
while(scanf("%f%s%f",&befo,unit,&ori)&&befo>=0&&ori>=0)
{
getchar();//用此接受前面的空格
gets(name);
propotion=befo/ori*100;
if(propotion<1)
{
flag=1;
strcpy(name1[i++],name);
}
else
printf("%s%.1f %s %0.0f%%\n",name,befo,unit,propotion);//c的输入输出流格式
}
if(flag)
{
printf("Provides no significant amount of:\n");
for(j=0;j<i;j++)
printf("%s\n",name1[j]);
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator