Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class hourglass_02 here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class Arrows
- {
- public static void main(String[] args)
- {
- line();
- up();
- up();
- line();
- down();
- down();
- line();
- }
- public static void line()
- {
- System.out.println("+------+");
- }
- public static void up()
- {
- for (int i = 2; i >=0 ; i--)
- {
- System.out.print("|");
- for (int j = i - 1; j >= 0; j--)
- {
- System.out.print(" ");
- }
- System.out.print("^");
- for (int j = 1 - i; j >= 0; j--)
- {
- System.out.print(" ");
- }
- System.out.print("^");
- for (int j = i - 1; j >= 0; j--)
- {
- System.out.print(" ");
- }
- System.out.println("|");
- }
- }
- public static void down()
- {
- for (int i = 0; i <= 2; i++)
- {
- System.out.print("|");
- for (int j = i - 1; j >= 0; j--)
- {
- System.out.print(" ");
- }
- System.out.print("V");
- for (int j = 1 - i; j >= 0; j--)
- {
- System.out.print(" ");
- }
- System.out.print("V");
- for (int j = i - 1; j >= 0; j--)
- {
- System.out.print(" ");
- }
- System.out.println("|");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement