Advertisement
ivanov_ivan

StripedTowel

Jun 3rd, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner input = new Scanner(System.in);
  7.         int n = Integer.parseInt(input.nextLine());
  8.         int m = (int) (n * 1.5);
  9.         for (int i = 0; i < m; i++) {
  10.             int x = i;
  11.             while (x < n + i) {
  12.                 if (x % 3 == 0) {
  13.                     System.out.print("#");
  14.                 } else {
  15.                     System.out.print(".");
  16.                 }
  17.                 x++;
  18.             }
  19.             System.out.println();
  20.         }
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement