Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 5th, 2011  |  syntax: Java  |  size: 0.37 KB  |  hits: 494  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class Govnokod2 {
  2.  
  3.         public static void main(String[] args) {
  4.                 for (int lineNumber = 1; lineNumber <= 6; lineNumber++) {
  5.                         for (int posInline = 1; posInline <= lineNumber; posInline++) {
  6.                                 System.out.print(((posInline != 1) ? "-" : "")
  7.                                                 + ((lineNumber % 2 != 0) ? posInline : (lineNumber - posInline + 1)));
  8.                         }
  9.                         System.out.println();
  10.                 }
  11.         }
  12.        
  13. }