added programs
This commit is contained in:
9
programs/prog4/info.json
Normal file
9
programs/prog4/info.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "演習1ー9",
|
||||
"description": "プロンプトから読み込んだ3つの整数値の和を表示するプログラム。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/prog4.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/prog4/main
Executable file
BIN
programs/prog4/main
Executable file
Binary file not shown.
19
programs/prog4/main.c
Normal file
19
programs/prog4/main.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n1;
|
||||
int n2;
|
||||
int n3;
|
||||
|
||||
printf("Input three integers.\n");
|
||||
printf("Integer n1: ");
|
||||
scanf("%d", &n1);
|
||||
printf("Integer n2: ");
|
||||
scanf("%d", &n2);
|
||||
printf("Integer n3: ");
|
||||
scanf("%d", &n3);
|
||||
|
||||
printf("The sum of three integers is %d.", n1 + n2 + n3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user