done
This commit is contained in:
25
programs/p418/main.c
Normal file
25
programs/p418/main.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define CHARSPERLINE 5
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
numInput:
|
||||
printf("Input integer: ");
|
||||
scanf("%d", &n);
|
||||
|
||||
if (n < 1) {
|
||||
puts("Please input non-zero positive integer.");
|
||||
goto numInput;
|
||||
}
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
putchar('*');
|
||||
if (i % CHARSPERLINE == 0) {
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user