Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner lukija = new Scanner(System.in);
- List<int> lista = new ArrayList<>();
- System.out.println("Syötä luvut: ");
- int muuttuja1;
- while (true) {
- muuttuja1 = Integer.parseInt(lukija.nextLine());
- if (muuttuja1 != -1) {
- lista.add(muuttuja1);
- } else {
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement