Skee Ball problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answers
+ 2
Try this: #include <stdio.h> int main() { int score; int price; int result; scanf("%d%d", &score, &price); result =(score/12); if(result >= price){ printf("Buy it!"); }else { printf("Try again"); } return 0; }
8th Aug 2020, 3:21 PM
Maharnab Saikia
Maharnab Saikia - avatar
+ 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