done
This commit is contained in:
22
programs/p414/main.c
Normal file
22
programs/p414/main.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user