Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string one="-",two="O";
- int q,t,kol,zz=0;
- cin>>q;
- kol=(q-1)/2;
- t=q-kol;
- for(int g=0;g<t;g++)
- {
- for(int i=0;i<q;i++)
- {
- if(i==kol || i==kol+zz)
- {cout<<two;}
- else
- {cout<<one;}
- }
- zz+=2;
- cout<<endl;
- kol--;
- }
- int dol=1;
- for(int s=0;s<t-1;s++)
- {
- for(int v=0;v<q;v++)
- {
- if(v==dol || v==((q-1)-dol))
- {cout<<two;}
- else
- {cout<<one;}
- }
- cout<<endl;
- dol+=1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement