Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner sc = new Scanner(System.in);
- ArrayList<Double> stock = new ArrayList<Double>();
- String s = sc.nextLine();
- String[] split = s.split("\s+");
- for (int i=0; i<split.length; i++)
- {
- stock.add(Double.parseDouble(split[i]));
- }
- Scanner sc = new Scanner(System.in);
- ArrayList<Double> stock = new ArrayList<Double>();
- while (sc.hasNextDouble())
- {
- double d = sc.nextDouble();
- stock.add(d);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement