draft
This commit is contained in:
10
programs/p48/info.json
Normal file
10
programs/p48/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習 4-8",
|
||||
"description": "教科書のList 4-8を1未満の時に改行を出力しないよにしたプログラム。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/p48.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/p48/main
Executable file
BIN
programs/p48/main
Executable file
Binary file not shown.
20
programs/p48/main.c
Normal file
20
programs/p48/main.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Input positive integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
if (n < 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (n-- > 0) {
|
||||
putchar('*');
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user