【发布时间】:2018-08-25 03:55:01
【问题描述】:
我正在尝试创建一个程序,您需要输入 3 个数字并需要告诉您哪个更大,我收到错误:[Error] expected '(' before 'else'. 错误在第 17 和 21 行。 这是代码。
using namespace std;
int main(){
int n1, n2, n3;
cout<<"Type 3 numbers : ";
cin>>n1>>n2>>n3;
if (n1 > n2 && n1 > n3){
cout<<"The graeter is : "<<n1;
}
if else{
(n2 > n3);
cout<<"The graeter is: "<<n2;
}
if else {
cout<<"The graeter is: "<<n3;
}
return 0;
}
【问题讨论】:
标签: dev-c++