fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int a;
  5. int b;
  6.  
  7. int main() {
  8. cin >> a >> b;
  9.  
  10. for (int i = 1; i <= a; i++){
  11. for (int j = 1; j <= b; j++){
  12. if (i%2 == 0){
  13. if (i%2 == 0 && j!= b){
  14. cout << ".";
  15. }
  16. else if ((i * 4 + 2) == 0 && j!= b){
  17. cout << ".";
  18. }
  19. else {
  20. cout << "#";
  21. }
  22.  
  23. }
  24. else{
  25. cout << "#";
  26. }
  27. }
  28. cout << endl;
  29. }
  30.  
  31. }
Success #stdin #stdout 0.01s 5288KB
stdin
9 9
stdout
#########
........#
#########
........#
#########
........#
#########
........#
#########