Files
information-processing-1_14…/programs/p418/main.c
2025-07-17 11:31:11 +09:00

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;
}