Advertisement
Guest User

9000

a guest
Sep 17th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. package javaapplication1;
  2. import java.util.Scanner;
  3.  
  4. public class JavaApplication1 {
  5. public static void main(String[] args) {
  6. int i;
  7. System.out.print("How many runners? ");
  8. Scanner input_data = new Scanner(System.in);
  9. int count = input_data.nextInt();
  10.  
  11. String[] ppl = new String[count];
  12. System.out.println(ppl.length);
  13.  
  14. for(i = 0; i < count ;++i) {
  15. System.out.print("Enter runner number " + (i + 1) + ": ");
  16. ppl[i] = input_data.next();
  17. }
  18. System.out.println("\n");
  19. for(i = 0; i < count; ++i) {
  20. System.out.println(ppl[count - (i + 1)]);
  21.  
  22. }
  23.  
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement