26 lines
394 B
C
26 lines
394 B
C
#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;
|
|
}
|