| ||||||||||
| 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 | |||||||||
真心伤不起啊!sizeof()与strlen(),60的区别!用strlen()函数正确,其他不正确!!用60输出多余的‘‘\n’!#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
double s,w,l;
while(cin>>s>>w>>l&&s*w*l!=0)
{
char ss[100]="";
if(s<=4.5&&w>=150&&l>=200){strcat(ss,"Wide Receiver ");};
if(s<=6.0&&w>=300&&l>=500){strcat(ss,"Lineman ");};
if(s<=5.0&&w>=200&&l>=300){strcat(ss,"Quarterback ");};
if(strcmp(ss,"")==0)cout<<"No positions"<<endl;
else{
for(int i=0;i<strlen(ss);i++)//
cout<<ss[i];
cout<<"\n";
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator