Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication1;
- import java.util.Scanner;
- public class JavaApplication1 {
- public static void main(String[] args) {
- int i;
- System.out.print("How many runners? ");
- Scanner input_data = new Scanner(System.in);
- int count = input_data.nextInt();
- String[] ppl = new String[count];
- System.out.println(ppl.length);
- for(i = 0; i < count ;++i) {
- System.out.print("Enter runner number " + (i + 1) + ": ");
- ppl[i] = input_data.next();
- }
- System.out.println("\n");
- for(i = 0; i < count; ++i) {
- System.out.println(ppl[count - (i + 1)]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement