act-3 spoj solution of basics
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,i,j,a,b;
cin>>t;
while(t--)
{
cin>>a>>b;
for(i=1;i<=3*a+1;i++)
{
for(j=1;j<=3*b+1;j++)
{
if (i%3==1 || j%3==1)
printf("*");
else
printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,i,j,a,b;
cin>>t;
while(t--)
{
cin>>a>>b;
for(i=1;i<=3*a+1;i++)
{
for(j=1;j<=3*b+1;j++)
{
if (i%3==1 || j%3==1)
printf("*");
else
printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
This comment has been removed by a blog administrator.
ReplyDelete