Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

确实找不出来了???哪里WA了?????

Posted by win1611 at 2010-02-02 16:55:20 on Problem 2810
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator