draft
This commit is contained in:
10
programs/p43/info.json
Normal file
10
programs/p43/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "課題3",
|
||||
"description": "教科書の演習4ー3の解答",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/p43.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/p43/main
Executable file
BIN
programs/p43/main
Executable file
Binary file not shown.
19
programs/p43/main.c
Normal file
19
programs/p43/main.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Input positive integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
while (n >= 0) {
|
||||
printf("%d ", n);
|
||||
n--;
|
||||
|
||||
if (n < 0) {
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user