fork(2) 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 = 10;
  15.  
  16. int lattePrice = 140;
  17. int cappucinoPrice = 160;
  18. int waterPrice = 20;
  19. int milkPrice = 50;
  20. }
  21.  
  22. boolean canBuyAnything = false;
  23.  
  24. if(moneyAmount >= lattePrice)
  25. {
  26. System.out.println("Вы можете купить латте");
  27. canBuyAnything = true;
  28. }
  29. if(moneyAmount >= cappucinoPrice )
  30. {
  31. System.out.println("Вы можете купить капучино ");
  32. canBuyAnything = true;
  33. }
  34. if(moneyAmount >= waterPrice)
  35. {
  36. System.out.println("Вы можете купить воду");
  37. canBuyAnything = true;
  38. }
  39. if(moneyAmount >= milkPrice)
  40. {System.out.println("Вы можете купить молоко");
  41. canBuyAnything = true;
  42. }
  43. if(!canBuyAnything)
  44. {
  45. System.out.println("Вы не можете ни чего купить!");
  46. }
  47. )
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:24: error: illegal start of type
		if(moneyAmount >= lattePrice) 
		^
Main.java:24: error: <identifier> expected
		if(moneyAmount >= lattePrice) 
		              ^
Main.java:24: error: ';' expected
		if(moneyAmount >= lattePrice) 
		                 ^
Main.java:24: error: illegal start of type
		if(moneyAmount >= lattePrice) 
		                            ^
Main.java:24: error: <identifier> expected
		if(moneyAmount >= lattePrice) 
		                             ^
Main.java:25: error: ';' expected
		{
		 ^
Main.java:26: error: illegal start of type
			System.out.println("?? ?????? ?????? ?????");
			      ^
Main.java:26: error: ';' expected
			System.out.println("?? ?????? ?????? ?????");
			          ^
Main.java:26: error: invalid method declaration; return type required
			System.out.println("?? ?????? ?????? ?????");
			           ^
Main.java:26: error: illegal start of type
			System.out.println("?? ?????? ?????? ?????");
			                   ^
Main.java:27: error: <identifier> expected
			canBuyAnything = true;
			              ^
Main.java:29: error: class, interface, or enum expected
		if(moneyAmount >= cappucinoPrice ) 
		^
Main.java:32: error: class, interface, or enum expected
			canBuyAnything = true;
			^
Main.java:33: error: class, interface, or enum expected
		}
		^
Main.java:37: error: class, interface, or enum expected
			canBuyAnything = true;
			^
Main.java:38: error: class, interface, or enum expected
		}
		^
Main.java:41: error: class, interface, or enum expected
			canBuyAnything = true;
			^
Main.java:42: error: class, interface, or enum expected
		}
		^
Main.java:46: error: class, interface, or enum expected
		}
		^
19 errors
stdout
Standard output is empty