Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public class Solution
  2. {
  3. public static void main(String[] args) {
  4. readData();
  5. }
  6.  
  7. public static void readData() {
  8. BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
  9. ArrayList list = new ArrayList();
  10. try{
  11. while (true){
  12. String fig = reader.readLine();
  13. int nFig = Integer.parseInt(fig);
  14. list.add(nFig);
  15. }
  16. }
  17. catch (Exception e){
  18. for (int i = 0; i < list.length; i++){
  19. System.out.println (i);
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement