Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main (String[] args) {
- // declare integer variables
- int i, r, c;
- // print horizontal line at top
- System.out.print ("+"); // corner
- for (c=0; c<6; c++) {
- System.out.print ("-");
- }// for c
- System.out.println ("+"); // corner and new line
- // outer loop
- for (i=0; i<2; i++) {
- // inner loop
- for (r=0; r<6; r++) {
- System.out.print ("|"); // vertical line
- if (r%3==0) {
- System.out.print (" ^^ ");
- } else if (r%3==1) {
- System.out.print (" ^ ^ ");
- } else {
- System.out.print ("^ ^");
- }// if
- System.out.println ("|"); // vertical line and new line
- } // end inner loop
- // print horizontal line
- System.out.print ("+"); // corner
- for (c=0; c<6; c++) {
- System.out.print ("-");
- }// for c
- System.out.println ("+"); // corner and new line
- } // end outer loop
- } // main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement