Waterfall.java - import [email protected] Jiacheng...

This preview shows page 1 out of 1 page.

import java.util.Scanner; /** * @author Jiacheng Ding * @version 1.0 */ public class Waterfall { /** * * @param args work */ public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int a; int i; int b = 0; int c = 0; a = scnr.nextInt(); if (a % 2 == 1) { for (i = a; i > 0; i--) { for (int j = i; j > 0; j--) { if (i % 2 == 1) { System.out.print("\\"); b++; } else {

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture