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; }
5 Antworten
+ 2
Swap cin>>guns and cin>>points and it should work
+ 2
because first input is the number of points and then number of guns
+ 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;
}
0
thanks
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