如何在我的代碼中聲明這一天?不僅是星期天,還有其他時間。如何申報一天?
#include <iostream>
using namespace std;
int main() {
int temperature;
char day = SUNDAY;
cout << "Enter your body temperature:" << endl ;
cin >> temperature ;
cout << "Enter what day:" << endl ;
cin >> day ;
if ((temperature > 40) && (day == SUNDAY))
cout << "Take sick certificate" << endl ;
else if (temperature > 40)
cout << "Do a light work" << endl ;
else if (temperature > 50)
cout << "Go to hospital!" << endl ;
else
cout << "Go to work" << endl ;
system("PAUSE");
return 0 ;
}
忘了作業標籤也許? –
不,這只是嘗試和錯誤形式我自己 – user3089175