fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. { int test_case,l,c,L,C,h,w;
  5. cin>>test_case;
  6. while(test_case!=0)
  7. {
  8. cin>>l>>c>>h>>w;
  9. L=(l+1)+(l*h);
  10. C=(c+1)+(c*w);
  11. for(int i=0;i<L;i++)
  12. {
  13. for(int j=0;j<C;j++)
  14. {
  15. if((i%(h+1)==0)||(j%(w+1)==0))
  16. cout<<"*"; // was bug
  17. else
  18. cout<<"."; // and here
  19. }
  20. cout<<"\n";
  21. }
  22. test_case--;
  23. cout << '\n'; // <--- not necessery
  24. }
  25. }
  26. /*
  27. Your code is very bad formatted or wrong pasted.
  28. */
Success #stdin #stdout 0s 4488KB
stdin
3
3 1 2 1
4 4 1 2
2 5 2 2
stdout
***
*.*
*.*
***
*.*
*.*
***
*.*
*.*
***

*************
*..*..*..*..*
*************
*..*..*..*..*
*************
*..*..*..*..*
*************
*..*..*..*..*
*************

****************
*..*..*..*..*..*
*..*..*..*..*..*
****************
*..*..*..*..*..*
*..*..*..*..*..*
****************