Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Slash {
- public static void create(int num) {
- for(int i = 0; i <= num; i++) {
- for(int j = 0; j < (i*2); j++) {
- System.out.print("\\");
- }
- for(int j = 0; j <= (num *4 ) - (i * 4) + 1; j++) {
- System.out.print("!");
- }
- for(int j = 0; j < (i*2); j++) {
- System.out.print("/");
- }
- System.out.println();
- }
- }
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Input Num");
- int max = sc.nextInt();
- create(max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement