0
Cheer Creator, keep failing test #3
I'm passing all the other tests except for test 3. Which is locked so I have no idea what's even going wrong. #include <iostream> using namespace std; int main() { int yard; int x; cin>>yard; if(yard >10) cout<<"High Five"; else if (yard < 1) cout<<"shh"; for (x=0; x < yard; x++) cout<<"Ra!"; return 0; } Please help. Thanks
3 ответов
+ 2
Hey try this logic 👇 which is very simple
#include <iostream>
using namespace std;
int main() {
int n; string new_text, text = "Ra!";
cin >> n;
if (n<1){
cout << "shh";
}
else if(n>1 && n <=10){
for(int i=0;i<n;i++)
{
new_text+=text;
}
cout<<new_text<<endl;
}
else{
cout << "High Five";
}
return 0;
}
+ 1
It worked. I'm assuming by comparing your code to mine. It had something to do with my "High Five" portion of the code. I'm not sure where mine went wrong though.
+ 1
Houston Cisneros if you give input as 11 it prini High Five + 11 times Ra! So that's why it's all cases not passed