Advertisement
abhishekj956

Untitled

Feb 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Slash {
  4.  
  5.  
  6. public static void create(int num) {
  7.  
  8. for(int i = 0; i <= num; i++) {
  9.  
  10. for(int j = 0; j < (i*2); j++) {
  11. System.out.print("\\");
  12.  
  13. }
  14. for(int j = 0; j <= (num *4 ) - (i * 4) + 1; j++) {
  15.  
  16. System.out.print("!");
  17. }
  18.  
  19.  
  20. for(int j = 0; j < (i*2); j++) {
  21. System.out.print("/");
  22.  
  23. }
  24. System.out.println();
  25.  
  26. }
  27.  
  28. }
  29.  
  30.  
  31.  
  32. public static void main(String[] args) {
  33.  
  34. Scanner sc = new Scanner(System.in);
  35.  
  36. System.out.println("Input Num");
  37. int max = sc.nextInt();
  38.  
  39. create(max);
  40.  
  41.  
  42.  
  43.  
  44. }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement