Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class AddAndSubtract {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int first = Integer.parseInt(scanner.nextLine());
- int second = Integer.parseInt(scanner.nextLine());
- int third = Integer.parseInt(scanner.nextLine());
- int sum = sum(first, second);
- int result = sum - third;
- System.out.println(result);
- }
- private static int sum(int first, int second) {
- return first + second;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment