输入三只小猪的体重,输出最重的小猪是哪只.
code
#include <iostream>
using namespace std;
int main()
{
int pigone = 0;
int pigtwo = 0;
int pigthree = 0;
cout << "LYQ家有三只小猪,L,Y和Q,今天LYQ同学想比较一下它们的体重,它们分别重" << endl;
cin >> pigone >> pigtwo >> pigthree;
if (pigone > pigtwo) {
if (pigone > pigthree) {
cout << "L最胖" << endl;
}
else cout << "Q最胖" << endl;
}
else if (pigtwo > pigthree) {
cout << "Y最胖" << endl;
}
else cout << "Q最胖" << endl;
system("pause");
return 0;
}