Witam potrzebuje napisać program ,który zwarca następującą piramide
?
+?
?+?
+?+?
Ja doszedłem do czegoś takiego:
?
?+
?+?
?+?+
Jakieś rady jak to powinno wyglądać?
Kod mojego rozwiązania :
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x, y;
x = 1;
while (x < 5)
{
for (y = 1; y <= x; y++) (y % 2 != 0) ? putchar('?') : putchar('+');
printf("\n");
x++;
}
system("pause");
return 0;
}