0

Skee ball

It can’t pass test 2 #include <iostream> using namespace std; int main() { int points; int guns; cin>>guns; cin>>points; if((points/12)>=guns){ cout<<"Buy it!"<<endl; } else { cout<<"Try again"<<endl; } return 0; }

13th Mar 2021, 7:06 AM
😴😴😴
😴😴😴 - avatar
5 Answers
+ 2
Swap cin>>guns and cin>>points and it should work
13th Mar 2021, 7:15 AM
Sveta Z.
Sveta Z. - avatar
+ 2
because first input is the number of points and then number of guns
13th Mar 2021, 7:16 AM
Sveta Z.
Sveta Z. - avatar
+ 1
Check the condition again. And there's no use of endl since it's not mentioned in the testcases. Try this out: #include <iostream> using namespace std; int main() { int squirt; int price; cin>>squirt; cin>>price; int c; c=squirt/12; if(price<=c) cout<<"Buy it!"; else cout<<"Try again"; return 0; }
13th Mar 2021, 7:56 AM
Aditya
Aditya - avatar
0
thanks
13th Mar 2021, 7:21 AM
😴😴😴
😴😴😴 - avatar
0
#include <iostream> using namespace std; int main() { int x, y ; cin >> x >> y ; int tickets(x/12) ; if (tickets >= y){ cout << "Buy it!" ; } else cout << "Try again" ; return 0; } https://code.sololearn.com/cTqJIe6pK7cu/?ref=app
9th Nov 2022, 11:22 PM
Scott D
Scott D - avatar