Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int day,month;
- cout<<"day?"<<endl;
- cin >> day;
- cout<<"month?"<<endl;
- cin >> month;
- switch(month){
- case 1:
- case 2:
- case 3: {
- if (day <= 21)
- cout<<"winter"<<endl;
- else
- cout<<"spring"<<endl;
- break;
- }
- case 4:
- case 5:
- case 6: {
- if (day <= 22)
- cout<<"spring"<<endl;
- else
- cout<<"summer"<<endl;
- break;
- }
- case 7:
- case 8:
- case 9: {
- if (day <= 23)
- cout<<"summer"<<endl;
- else
- cout<<"autum"<<endl;
- break;
- }
- case 10:
- case 11:
- case 12: {
- if (day <= 21)
- cout<<"autum"<<endl;
- else
- cout<<"winter"<<endl;
- break;
- }
- default:
- cout<<"default"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement