This commit is contained in:
2025-06-19 17:30:16 +09:00
parent 261688c4bc
commit 3a3c8f4675
27 changed files with 340 additions and 24 deletions

View File

@@ -1,10 +1,10 @@
{
"language": "",
"name": "",
"description": "",
"language": "C",
"name": "演習 3-12",
"description": "教科書のList 3-4をSwitch文で書き換えたプログラム。",
"output": {
"type": "screenshot | text",
"content": ""
"type": "screenshot",
"content": "./assets/p312.png"
},
"note": ""
}

BIN
programs/p312/main Executable file

Binary file not shown.

View File

@@ -0,0 +1,21 @@
#include <stdio.h>
int main(void) {
int n;
printf("Input Integer: ");
scanf("%d", &n);
switch (n % 2) {
case 0:
puts("The number is even.");
break;
case 1:
puts("The number is odd.");
break;
default:
puts("Unknown Error");
}
return 0;
}