include iostream using namespace std int main int spaces int plus for

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
using namespace std;
int main()
{
int spaces=3;
int plus = 1;
for (int i=1;i<=7;i++){
for(int s=1;s<=spaces;s++)
{
cout << " ";
}
for(int s=1;s<=plus;s++)
{
cout << " + ";
}
if(i > 3 ){
spaces++;
plus = plus - 2 ;
}
else
{
spaces--;
plus = plus + 2 ;
}
cout << endl;
}
}