fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. BufferedReader input = new BufferedReader(reader);
  10.  
  11. String inputValues;
  12. String[] person;
  13. List<String> lastname = new ArrayList<String>();
  14. List<String> firstname = new ArrayList<String>();
  15. List<String> id = new ArrayList<String>();
  16.  
  17. while(true){
  18. inputValues = input.readLine();
  19. person = inputValues.split("\\s+");
  20. if(inputValues.equals("exit")){
  21. break;
  22. }else{
  23. lastname.add(person[0]);
  24. firstname.add(person[1]);
  25. id.add(person[2]);
  26. }
  27. }
  28.  
  29. for(int i=0; i<lastname.size(); i++)
  30. System.out.println(firstname.get(i) +" "+ lastname.get(i) +" ("+ id.get(i) +")");
  31. }
  32. }
Success #stdin #stdout 0.11s 320256KB
stdin
maier, hans 456
jobs, steve 123
exit
stdout
hans maier, (456)
steve jobs, (123)