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. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. int p =0;
  13. for (int a=1;a<=6;a++)
  14. for (int b=1;b<=6;b++)
  15. for (int c=1;c<=6;c++)
  16. if (a+b==7 || a+c==7 || b+c==7)
  17. p++;
  18. System.out.println("There are "+p+" of 216 ways");
  19. }
  20. }
Success #stdin #stdout 0.1s 35788KB
stdin
Standard input is empty
stdout
There are 90 of 216 ways