看看下面的这个代码哪儿错了啊!求三个数中的最大者!
输入:每行中输入3个整数,长整型的!
输出:每行三个整数中的大者,每组数据输出一行
样列输入:
2 5 9
8 24 1
样列输出:
9
24
//2.7
#include<iostream>
using namespace std;
int main(){
long int a,b,c,max;
while(cin>>a,b,c){
max=a;
if(a<b)
max=b;
if(max<c)
max=c;
cout<<max<<endl;
}
return 0;
}
[解决办法]
#include<iostream>using namespace std;int main(){long int a,b,c,max;while(cin>>a>>b>>c){max=a;if(a<b)max=b;if(max<c)max=c;cout<<max<<endl;}return 0;}
[解决办法]
while(cin>>a,b,c){
错误
while(cin>>a>>b>>c){