fork download
  1. #include <iostream>
  2. #include <cstdio>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int t;
  10. scanf("%d",&t);
  11. while(t--)
  12. {
  13. int l, c, s;
  14. scanf("%d %d %d", &l, &c, &s);
  15. const int breadth = (c * (s + 1)) + 1;
  16. const int height = (l * (s + 1)) + 1;
  17. for(int i = 0; i < height; i++)
  18. {
  19. for(int j = 0; j < breadth; j++)
  20. {
  21. if(i % (s+1) == 0 || j % (s+1) == 0)
  22. {
  23. printf("*");
  24. }
  25. else if((i/(s+1) + j/(s+1)) % 2 == 0)
  26. {
  27. if(i % (s+1) == j % (s+1))
  28. {
  29. printf("\\");
  30. }
  31. else
  32. {
  33. printf(".");
  34. }
  35. }
  36. else
  37. {
  38. if(i % (s+1) == (s+1) - (j % (s+1)))
  39. {
  40. printf("/");
  41. }
  42. else
  43. {
  44. printf(".");
  45. }
  46. }
  47. }
  48. printf("\n");
  49. }
  50. printf("\n");
  51. }
  52. }
  53.  
Success #stdin #stdout 0s 16064KB
stdin
3
3 1 2
4 4 1
2 5 2
stdout
****
*\.*
*.\*
****
*./*
*/.*
****
*\.*
*.\*
****

*********
*\*/*\*/*
*********
*/*\*/*\*
*********
*\*/*\*/*
*********
*/*\*/*\*
*********

****************
*\.*./*\.*./*\.*
*.\*/.*.\*/.*.\*
****************
*./*\.*./*\.*./*
*/.*.\*/.*.\*/.*
****************