fork download
  1. ь copy
  2.  
  3.  
  4. import java.util.*;
  5. import java.lang.*;
  6. import java.io.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. System.out.println("Кофе-машина");
  14.  
  15. int moneyAmount = 50;
  16.  
  17. int cappucinoPrice = 150;
  18. int americanoPrice = 80;
  19. int waterPrice = 20;
  20. int milkPrict = 50;
  21. boolean canBuyAnything = false;
  22.  
  23. if(moneyAmount >= cappucinoPrice) {
  24. System.out.println("Вы можете купить капучино");
  25. canBuyAnything = true;
  26. }
  27.  
  28. if(moneyAmount >= americanoPrice) {
  29. System.out.println("Вы можете купить американо");
  30. canBuyAnything = true;
  31. }
  32.  
  33. if(moneyAmount >= waterPrice) {
  34. System.out.println("Вы можете купить воду");
  35. canBuyAnything = true;
  36. }
  37. if(moneyAmount >= milkPrice) {
  38. System.out.prinLn("Вы можете купить молоко");
  39. canBuyAnything = true;
  40. }
  41. if(canBuyAnything == false) {
  42. System.out.println("Недостаточно средств :( Изучайте Java и зарабатывайте много!))");
  43. }
  44. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
? copy
^
Main.java:44: error: reached end of file while parsing
	}
	 ^
2 errors
stdout
Standard output is empty