Advertisement
desislava_topuzakova

01. Integer Operations

Sep 24th, 2022
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1. package dataTypes.exercise;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class IntegerOperations_01 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         //1. входни данни
  9.         //2. ((първо + второ) / трето) * четвърто
  10.         //3. печатаме
  11.         int firstNumber = Integer.parseInt(scanner.nextLine());
  12.         int secondNumber = Integer.parseInt(scanner.nextLine());
  13.         int thirdNumber = Integer.parseInt(scanner.nextLine());
  14.         int forthNumber = Integer.parseInt(scanner.nextLine());
  15.  
  16.         int result = ((firstNumber + secondNumber) / thirdNumber) * forthNumber;
  17.         System.out.println(result);
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement