fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10.  
  11. public static void main(String args[]){
  12. Scanner sc = new Scanner(System.in);
  13. int A = sc.nextInt();
  14. int B = sc.nextInt();
  15. int C = sc.nextInt();
  16.  
  17. int sum = A+B+C;
  18. double avg = sum/3.0;
  19. System.out.println(avg);
  20. }
  21.  
  22. }
Success #stdin #stdout 0.19s 56564KB
stdin
9
6
4
stdout
6.333333333333333