0

Why test case 3 always gone wrong ! Please tell me what is wrong with my code

https://www.sololearn.com/coach/21?ref=app import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner in = new Scanner(System.in); int point = in.nextInt(); int price = in.nextInt(); int ticket = point / 2; if(ticket > price) { System.out.println("Buy it!"); } else System.out.println("Try again"); } }

11th Feb 2020, 6:56 PM
JAIN
JAIN - avatar
1 Odpowiedź
+ 1
You receive a ticket for every 12 points... Edit: And what happens when you gain 12 points and the gun costs 1 ticket???
11th Feb 2020, 7:01 PM
Mihai Apostol
Mihai Apostol - avatar