0

Skee Ball problem

#include <stdio.h> int main() { int p; int t; scanf("%d%d", &p, &t); t=(p/12); if(t>=40){ printf("Buy it!"); }else{ printf("Try again"); } return 0; } This is my attempt to solve the skee ball problem.All test case ok without one test case.Need your suggestions.

23rd Apr 2020, 2:42 AM
Shafiqul Islam
Shafiqul Islam - avatar
3 Respostas
+ 1
points is first input cost is second input tickets = points / 12 if tickets >= cost Buy it! else Try again you're taking t as an input for the cost and then setting it to the tickets and comparing all ticket calculations to a cost of 40 which you don't know
23rd Apr 2020, 4:21 AM
ChaoticDawg
ChaoticDawg - avatar
0
My Python code : points= int(input()) cost = int(input()) tickets = points / 12 if tickets >= cost: print("Buy it!") else: print("Try again")
2nd Jun 2020, 3:06 PM
Kogan
Kogan - avatar