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

Untitled

By: a guest on Apr 17th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 11  |  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. import java.util.Scanner;
  2.  
  3.  
  4. public class Reverse1 {
  5.  
  6.         /**
  7.          * @param args
  8.          */
  9.         public static void main(String[] args) {
  10.                
  11.                 int numElements = 10;
  12.                 int [] a = new int [numElements];
  13.                 int nextTerm = 0, i;
  14.                 String b = null;
  15.                
  16.                 Scanner in = new Scanner(System.in);
  17.                
  18.                 for (i = 0; i < a.length; ++i)
  19.                         nextTerm = in.nextInt();
  20.                         a[i] = nextTerm;
  21.                
  22.                 for (i = 0; i < a.length; ++i)
  23.                         b = a[i] + " " + b;
  24.                
  25.                 System.out.printf("b\n");
  26.         }
  27.  
  28. }