progress
This commit is contained in:
10
programs/a2/info.json
Normal file
10
programs/a2/info.json
Normal 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
BIN
programs/a2/main
Executable file
Binary file not shown.
24
programs/a2/main.c
Normal file
24
programs/a2/main.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user