Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int x,y,p,i;
- char j;
- cin>>x>>y>>p;
- for(i=1;i<=((x*p)+x+1);i++)
- {
- if (i%(p+1)==1)
- {
- for(j=1;j<=((x*p)+x+1);j++)
- {
- if(j%(p+1)==1)
- {
- cout<<"+";
- }
- else
- {
- cout<<"-";
- }
- }
- cout<<"\n";
- }
- else
- {
- for(j=1;j<=((y*p)+y+1);j++)
- {
- if(j%(p+1)==1)
- {
- cout<<"|";
- }
- else if (((((y+1)+(p*y)-i+1)%(p+1))==(j%(p+1))) && (((i%(p+1)))==((j%(p+1)))))
- {
- cout<<"x";
- }
- else if ((((y+1)+(p*y)-i+1)%(p+1))== (j%(p+1)))
- {
- cout<<"/";
- }
- else if ((i%(p+1))==((j%(p+1))))
- {
- cout<<"\\";
- }
- else
- {
- cout<<" ";
- }
- }cout<<"\n";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement