Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Sumar {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int suma = 0;
- while (scan.hasNextInt()) {
- int num = scan.nextInt();
- suma += num;
- }
- System.out.println("Suma: " + suma);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment