Я должен распечатать рисунок
Input: 3 3 1 4 4 2 5 Output: **** *..* *..* **** *..* *..* **** *..* *..* **** ************* *..*..*..*..* *..*..*..*..* ************* *..*..*..*..* *..*..*..*..* ************* *..*..*..*..* *..*..*..*..* ************* *..*..*..*..* *..*..*..*..* ************* **************** *..*..*..*..*..* *..*..*..*..*..* **************** *..*..*..*..*..* *..*..*..*..*..* ****************
Что я уже пробовал:
#include <iostream> using namespace std; int main() { int i,j,l,c,t; cin>>t; while(t>0) { cin>>l>>c; for(i=1;i<=3*l+1;i++) { if(i%3==1) { for(int p=1;p<=3*c+1;p++) { cout<<"*"; } cout<<"\n"; } for(j=1;j<=3*c+1;j++) { if(j%3==1) cout<<"*"; else cout<<"."; } cout<<"\n"; } cout<<"\n"; t--; } return 0; }
мой выход из:
**** *..* *..* *..* **** *..* *..* *..* **** *..* *..* *..* **** *..* ************* *..*..*..*..* *..*..*..*..* *..*..*..*..* ************* *..*..*..*..* *..*..*..*..* *..*..*..*..* ************* *..*..*..*..* *..*..*..*..* *..*..*..*..* ************* *..*..*..*..* *..*..*..*..* *..*..*..*..* ************* *..*..*..*..* **************** *..*..*..*..*..* *..*..*..*..*..* *..*..*..*..*..* **************** *..*..*..*..*..* *..*..*..*..*..* *..*..*..*..*..* **************** *..*..*..*..*..*