fork download
  1. class Main{
  2. public static void main(String[] args) throws Exception {
  3. int victories = 0;
  4. int losses = 0;
  5. for(int red = 1; red <= 6; red++){
  6. for(int green = 1; green <= 6; green++){
  7. for(int blue = 1; blue <= 6; blue++){
  8. if(red >= green && red >= blue){
  9. victories++;
  10. }
  11. else{
  12. losses++;
  13. }
  14. }
  15. }
  16. }
  17.  
  18. System.out.println("You win " + victories + " times and lose " + losses + " times out of a total of " + (victories + losses) + " times");
  19. }
  20. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
You win 91 times and lose 125 times out of a total of 216 times