Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- int month = 4;
- switch (month) {
- case 12: case 1: case 2:
- puts("冬です"); break;
- case 3: case 4: case 5:
- puts("春です"); break;
- case 6: case 7: case 8:
- puts("夏です"); break;
- case 9: case 10: case 11:
- puts("秋です"); break;
- default:
- break;
- }
- int mdiv = month / 3;
- if (mdiv == 0 || mdiv == 4) puts("冬です");
- else if (mdiv == 1) puts("春です");
- else if (mdiv == 2) puts("夏です");
- else puts("秋です");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement