问题遇到的现象:输入数字以后又回到了编程页
#include
using namespace std;
int main()
{int a,b,c;
cin>>a>>b>>c;
if (a>b&&b>c)
cout<else
{if (b>c)
cout<else
cout<system("pause");
return 0;
}
我想要达到的结果:用我的逻辑,3个数求最大值。
应该这样,不用else,输出最大值为x
if (x<y)
{
a=x;
x=y;
y=a;
}
if(z>y)
{
a=y;
y=z;
z=a;
}
if (x<y)
{
a=x;
x=y;
y=a;
}
#include <iostream>
using namespace std;
int main()
{int a,b,c;
cin>>a>>b>>c;
if (a>c&&a>b)
cout<<a;
else
{if (b>c)
cout<<b;
else
cout<<c;
}
system("pause");
return 0;
}
新弄的好像更亂了,嘿嘿