draft
This commit is contained in:
10
programs/p410/info.json
Normal file
10
programs/p410/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習 4-10",
|
||||
"description": "入力した整数値の個数分縦にアスタリスクを表示するプログラム。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/p410.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/p410/main
Executable file
BIN
programs/p410/main
Executable file
Binary file not shown.
21
programs/p410/main.c
Normal file
21
programs/p410/main.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Input positive integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
if (n < 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (n-- > 0) {
|
||||
putchar('*');
|
||||
if (n != 0) {
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user