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