-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp3.cpp
More file actions
31 lines (30 loc) · 708 Bytes
/
p3.cpp
File metadata and controls
31 lines (30 loc) · 708 Bytes
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
31
//Google code jam'22 qualification round Q1-Punched cards.
#include<iostream>
using namespace std;
int main()
{
int t,r,c;
cin>>t;
for(int i=1;i<=t;i++)
{
cin>>r>>c;
cout<<"Case #"<<i<<endl;
for(int j=0;j<2*r+1;j++)
{
for(int k=0;k<2*c+1;k++)
{
if(k<2 && j<2)
cout<<".";
else if(j%2!=0 && k%2!=0)
cout<<".";
else if(j%2==0 && k%2==0)
cout<<"+";
else if(j%2==0 && k%2!=0)
cout<<"-";
else if(j%2!=0 && k%2==0)
cout<<"|";
}
cout<<"\n";
}
}
}