Advertisement
Dilyana86

Untitled

Apr 14th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class stripedTowel300815 {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6. int size = Integer.parseInt(scan.nextLine());
  7. int width = size;
  8. int height = size + size / 2;
  9. for (int i = 0; i < height; i++){
  10. for (int j = 0; j < width; j++){
  11. if ((j + i) % 3 == 0){
  12. System.out.print("#");
  13. }else{
  14. System.out.print(".");
  15. }
  16. }
  17. System.out.println();
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement