+ 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
11 ответов
+ 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