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, na końcu daj zero by zakończyć, program zsumuje liczby");
- Scanner load = new Scanner(System.in);
- float i;
- for (i = 0; i < Integer.MAX_VALUE; i++) {
- float sum = 0;
- sum += load.nextDouble();
- if (sum == 0)
- ;
- break;
- }
- System.out.println("Suma wprowadzonych przez Ciebie liczb to: " + sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment