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 <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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator