22 lines
260 B
C
22 lines
260 B
C
#include <stdio.h>
|
|
|
|
int main(void) {
|
|
int n;
|
|
|
|
printf("Input positive integer: ");
|
|
scanf("%d", &n);
|
|
|
|
if (n <= 0) {
|
|
return 1;
|
|
}
|
|
|
|
int i = 1;
|
|
|
|
while (i <= n) {
|
|
printf("%d ", i++);
|
|
}
|
|
printf("\n");
|
|
|
|
return 0;
|
|
}
|