Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication14;
- import java.util.Scanner;
- public class JavaApplication14 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int a=0;
- int b=0;
- System.out.print("Podaj liczbę (mniejsza od zera, wyłączy program) \n");
- while(a>=0){
- a = input.nextInt();
- b+=a;
- }
- System.out.println("Suma liczb, które wpisałeś to : "+b);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement