Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Sumator {
- public static void main(String[] args) {
- System.out.println("Wprowadź liczby jakie chcesz, zakończ zerem, program zsumuje wszyskite liczby i wyświetli wynik");
- //inicjuję scanner
- Scanner load = new Scanner(System.in);
- int numbers = Integer.MAX_VALUE;
- int n = Integer.MAX_VALUE;
- int i;
- int result = 0;
- for (i=1; i<=n; i++){
- numbers = load.nextInt();
- result+=numbers[i];
- if (numbers==0);
- break;
- System.out.println("Wynik to: " + result);
- }}}
Advertisement
Add Comment
Please, Sign In to add comment