+ 2
Help! Is the Skee Ball Challenge bugged?
Why does my try at the Skee Ball Challenge not work? Please tell me my errors and how I can improve my code: https://www.sololearn.com/post/617423/?ref=app
12 Respostas
+ 7
{The Piqued Learner}
Remove string buyOrNot!!!
Also you wrote the output wrong.
It's "Buy it!"
Not "Buy It!"
+ 5
{The Piqued Learner}
Just copy paste it in the play ground. It'll work.
#include <iostream>
using namespace std;
int main() {
int numberOfPoints;
int squirtGunPriceInTix;
cin>>numberOfPoints ;
cin>>squirtGunPriceInTix;
numberOfPoints = (numberOfPoints/12);
if(numberOfPoints>=squirtGunPriceInTix)
cout<<"Buy it!";
else
cout<<"Try again";
return 0;
}
+ 5
{The Piqued Learner} Great buddy âșïžđ
+ 4
{The Piqued Learner}
Challenge is not bugged.
In your code what is string buyOrNot doing?
Remove that line.. It'll work.
+ 2
Minho đ°đ· Thanks tho.
+ 2
Minho đ°đ· Thanks, but I edited it before you sent me the copy.
+ 1
Minho đ°đ· It gave me more failed test cases, with one actually correct but indicated failed.
+ 1
đžđžđž Here:
#include <iostream>
using namespace std;
int main() {
int numberOfPoints;
int squirtGunPriceInTix;
string buyOrNot;
cin >> numberOfPoints;
cin >> squirtGunPriceInTix;
numberOfPoints = numberOfPoints / 12;
if (numberOfPoints >= squirtGunPriceInTix) {
cout << "Buy It!";
} else {
cout << "Try again";
}
return 0;
}
+ 1
It's tiring going back and forth...
Here tho:
https://www.sololearn.com/post/617744/?ref=app
+ 1
Minho đ°đ· THE PROBLEM IS NOT WITH THE LINE!!! ITS JUST THE 'Buy it!'
+ 1
One of the most simplest solution for this challenge
int main()
{
int point, cost;
cin>>point>>cost;
if((point/12)>=cost)
cout<<"Buy it!";
else
cout<<"Try again";
return 0;
}
If there is any mistakes, point it out and notify me