Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class stripedTowel300815 {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int size = Integer.parseInt(scan.nextLine());
- int width = size;
- int height = size + size / 2;
- for (int i = 0; i < height; i++){
- for (int j = 0; j < width; j++){
- if ((j + i) % 3 == 0){
- System.out.print("#");
- }else{
- System.out.print(".");
- }
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement