2018年5月12日 星期六

itsa基 6 季節判定

#include <iostream>
using namespace std;

int main ()
{
int month;
cin >> month;
switch (month)
{
case 3:
case 4:
case 5:
cout << "Spring" << endl;
break;
case 6:
case 7:
case 8:
cout << "Summer" << endl;
    break;
case 9:
case 10:
case 11:
cout << "Autumn" << endl;
break;
case 12:
case 1:
case 2:
cout << "Winter" << endl;
break;
}
return 0;
}

2 則留言: