started assignment and added programs
This commit is contained in:
10
programs/p26/info.json
Normal file
10
programs/p26/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題1 演習2ー6",
|
||||
"description": "身長を整数値として読み込み、標準体重を実数小数点以下1桁として表示するプログラム。なお標準体重は$0.9(height - 100)$で求めるものとする。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/p26.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
12
programs/p26/main.c
Normal file
12
programs/p26/main.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int height;
|
||||
|
||||
printf("Input your height in cm: ");
|
||||
scanf("%d", &height);
|
||||
|
||||
printf("Standard weight is %.1fkg.\n", 0.9 * (double)(height - 100));
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user