This commit is contained in:
2025-07-17 11:31:11 +09:00
parent 1cc0c43954
commit e304f900ee
29 changed files with 281 additions and 107 deletions

10
programs/p414/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "演習 4-14",
"description": "1,2,3...8,9,0を入力した整数値個表示するプログラム。",
"output": {
"type": "screenshot",
"content": "./assets/p414.png"
},
"note": ""
}

BIN
programs/p414/main Executable file

Binary file not shown.

22
programs/p414/main.c Normal file
View File

@@ -0,0 +1,22 @@
#include <stdio.h>
int main(void) {
int n;
numInput:
printf("Input positive integer: ");
scanf("%d", &n);
if (n < 0) {
puts("Please input positive integer.");
goto numInput;
}
for (int i = 1; i <= n; i++) {
printf("%d", i % 10);
}
putchar('\n');
return 0;
}