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 sjjwind at 2011-03-13 15:38:59 on Problem 2070
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int w,st;
	double s;
	int i;
	int flag;
	int flag1;
	char position[3][20]={"Wide Receiver","Lineman","Quarterback"};	
	double speed[3]={4.5,6.0,5};
	int weight[3]={150,300,200};
	int strength[3]={200,500,300};
	while(scanf("%llf %d %d",&s,&w,&st)!=EOF&&(s||w||st))
	{
		flag=0;
		flag1=0;
		for(i=0;i<3;i++)
		{
			if(s<=speed[i])
			{
				if(w>=weight[i])
				{
					if(st>=strength[i])
					{
						if(flag==1) printf(" %s",position[i]);
						else printf("%s",position[i]);	
						flag=1;
						flag1=1;
					}
				}
			}
			
		}
		if(flag1==0) printf("No positions");
		printf("\n");		
	}
}

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