#include <iostream>
typedef int temperature;
temperature celsiustemperature[4];
int main()
{
using namespace std;
cout << "Enter a start temperature in celsius: ";
cin >> celsiustemperature[0];
cout << "Enter an end temperature in celsius: ";
cin >> celsiustemperature[1];
cout << "You printed " << celsiustemperature[0] << " and " << celsiustemperature[1] << "." << " Is this correct?" << endl;
char szYesOrNo;
cin >> szYesOrNo;
switch (szYesOrNo)
{
case "yes":
cout << "win";
break;
case "no":
cout << "winner";
break;
}
return 0;
}
我无法弄清楚以下代码有什么问题。很抱歉没有添加评论;win
如果用户输入yes
和winner
用户输入,我希望它打印no
。