IMohammedNasr

Untitled

Apr 2nd, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int r, c;
  2. cin >> r >> c;
  3. for (int i = 0; i < r * 2 + 1; i++)
  4. {
  5. for (int j = 0; j < c * 2 + 1; j++)
  6. {
  7. if ((i == 0 or i == 1) and (j == 1 or j == 0))
  8. {
  9. cout << ".";
  10. }
  11. else if (i % 2 == 0)
  12. cout << (j % 2 ? '-' : '+');
  13. else
  14. cout << (j % 2 ? '.' : '|');
  15. }
  16. cout << '\n';
  17. }
Advertisement
Add Comment
Please, Sign In to add comment