Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public class Solution {
  2. public static void main(String[] args) throws Exception {
  3. ArrayList<String> list = new ArrayList<String>();
  4. BufferedReader str = new BufferedReader(new InputStreamReader(System.in));
  5. for (int i = 0; i < 10; i++) {
  6. list.add(str.readLine());
  7. }
  8.  
  9. ArrayList result = doubleValues(list);
  10. for (int i = 0; i < result.size(); i++) {
  11. System.out.println(result.get(i));
  12. }
  13.  
  14. // Вывести на экран result
  15. }
  16.  
  17. public static ArrayList doubleValues(ArrayList<String> list) {
  18. for (int i = 0; i < list.size(); i++) {
  19. list.add(i,list.get(i));
  20. i++;
  21. }
  22. return list;
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement