added programs
This commit is contained in:
9
programs/prog3/info.json
Normal file
9
programs/prog3/info.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "演習1ー8",
|
||||
"description": "プロンプトから読み込んだ2つの整数値の積を表示するプログラム。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/prog3.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/prog3/main
Executable file
BIN
programs/prog3/main
Executable file
Binary file not shown.
16
programs/prog3/main.c
Normal file
16
programs/prog3/main.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n1;
|
||||
int n2;
|
||||
|
||||
printf("Input two integers.\n");
|
||||
printf("Integer n1: ");
|
||||
scanf("%d", &n1);
|
||||
printf("Integer n2: ");
|
||||
scanf("%d", &n2);
|
||||
|
||||
printf("The product of two integers is %d.", n1 * n2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
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;
|
||||
}
|
||||
9
programs/prog5/info.json
Normal file
9
programs/prog5/info.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "考察:List 1-11",
|
||||
"description": "List 1-11 にて、入力に3.14や0.5などの小数を入力すると出力はどうなるか。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/prog5.png"
|
||||
},
|
||||
"note": "入力した全ての小数が繰り下げられている。\\\\texttt{\\%d}は整数しか表示できず、小数の場合は小数部を切り捨て、整数部のみ表示している。"
|
||||
}
|
||||
BIN
programs/prog5/main
Executable file
BIN
programs/prog5/main
Executable file
Binary file not shown.
12
programs/prog5/main.c
Normal file
12
programs/prog5/main.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int no;
|
||||
|
||||
printf("Input an integer: ");
|
||||
scanf("%d", &no);
|
||||
|
||||
printf("You inputed %d.\n", no);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user