This commit is contained in:
2025-06-26 15:18:33 +09:00
parent e027e09906
commit 451aaee7ce
33 changed files with 366 additions and 106 deletions

10
programs/a4/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "課題4",
"description": "1年の月の日数を返すプログラム。",
"output": {
"type": "screenshot",
"content": "./assets/a4.png"
},
"note": ""
}

BIN
programs/a4/main Executable file

Binary file not shown.

29
programs/a4/main.c Normal file
View File

@@ -0,0 +1,29 @@
#include <stdio.h>
int main(void) {
int month;
printf("Input month: ");
scanf("%d", &month);
if (month < 1 || month > 12) {
puts("Unknown month");
return 1;
}
switch (month) {
case 2:
puts("28 days");
break;
case 4:
case 6:
case 9:
case 11:
puts("30 days");
break;
default:
puts("31 days");
}
return 0;
}