Advertisement
CR7CR7

Int scanned from the input

Sep 12th, 2022
889
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. package com.telerikacademy;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ScannerNextInt {
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.         // This function returns the Int scanned from the input.
  9.         int a = input.nextInt();
  10.         int b = input.nextInt();
  11.         int c = input.nextInt();
  12.  
  13.         // Print the sum of all numbers
  14.         System.out.println(a + b + c);
  15.     }
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement