#include<iostream>
using namespace std;
int main()
{
cout << "三只小猪称体重" << endl;
int a,b,c = 0;
cout << "请输入小猪①的体重" << endl;
cin >> a;
cout << "请输入小猪②的体重" << endl;
cin >> b;
cout << "请输入小猪③的体重" << endl;
cin >> c;
if (a > b)
{
if (a > c)
{
cout << "小猪①最重,它的体重是:" << a << endl;
}
else
{
cout << "小猪③最重,它的体重是:" << c << endl;
}
}
else {
if (b > c)
{
cout << "小猪②最重,它的体重是:" << b << endl;
}
else {
cout << "小猪③最重,它的体重是:" << c << endl;
}
}
system("pause");
return 0;
}
三只小猪称体重
最新推荐文章于 2024-05-13 14:11:50 发布