Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.Scanner;
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8.     public static void main (String[] args) throws java.lang.Exception
  9.     {
  10.         Scanner in = new Scanner(System.in);
  11.      
  12.         int a = in.nextInt();
  13.         int b = in.nextInt();
  14.         int c = in.nextInt();
  15.        
  16.         int sum;
  17.        
  18.         sum = a + b + c;
  19.        
  20.         if(sum % 3 == 0)
  21.         {
  22.        
  23.              System.out.printf("The product of the numbers: %d \n", a * b * c);
  24.        
  25.         }
  26.         else System.out.printf("The sum of the numbers is not divisible by 3");
  27.        
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement