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/a2/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "課題2",
"description": "入力した3つの整数値が小さい順または等価になっているかを検証するプログラム。",
"output": {
"type": "screenshot",
"content": "./assets/a2.png"
},
"note": ""
}

BIN
programs/a2/main Executable file

Binary file not shown.

24
programs/a2/main.c Normal file
View File

@@ -0,0 +1,24 @@
#include <stdio.h>
int main(void) {
int a, b, c;
printf("Input integer #1: ");
scanf("%d", &a);
printf("Input integer #2: ");
scanf("%d", &b);
printf("Input integer #3: ");
scanf("%d", &c);
if (a <= b) {
if (b <= c) {
puts("OK");
} else {
puts("NG");
}
} else {
puts("NG");
}
return 0;
}