#include <stdio.h>
int main() {
int month;
printf("input month : ");
scanf("%d", &month);
if (month < 1 || month > 12) {
puts("Error");
return 0;
}
switch (month) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
puts("31");
break;
case 4:
case 6:
case 9:
case 11:
puts("30");
case 2:
puts("28 or 29");
default:
#include <stdio.h>
int main() {
int month;
printf("input month : ");
scanf("%d", &month);
if (month < 1 || month > 12) {
puts("Error");
return 0;
}
switch (month) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
puts("31");
break;
case 4:
case 6:
case 9:
case 11:
puts("30");
break;
case 2:
puts("28 or 29");
break;
default:
puts("Error");
}
return 0;
}