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. System.out.println("Кофе-машина");
  13.  
  14. int moneyAmount = 12;
  15.  
  16. int cappucinoPrice = 150;
  17. int espressoPrice = 80;
  18. int waterPrice = 20;
  19. int milkPrice=60
  20. boolean canBuyAnything = false;
  21.  
  22. if(moneyAmount >= cappucinoPrice) {
  23. System.out.println("Вы можете купить капучино");
  24. canBuyAnything = true;
  25. }
  26.  
  27. if(moneyAmount >= espressoPrice) {
  28. System.out.println("Вы можете купить эспрессо");
  29. canBuyAnything = true;
  30. }
  31.  
  32. if(moneyAmount >= waterPrice) {
  33. System.out.println("Вы можете купить воду");
  34. canBuyAnything = true;
  35. }
  36. if(moneyAmount >= milkPrice) {
  37. System.out.println("Вы можете купить молоко");
  38. if(canBuyAnything == false) {
  39. System.out.println("Недостаточно средств :( Учите Java и зарабатывайте много! :)");
  40. }
  41. }
  42. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:19: error: ';' expected
		int milkPrice=60
		                ^
Main.java:42: error: reached end of file while parsing
}
 ^
2 errors
stdout
Standard output is empty