+ 2
Code coach : cheer creator
My third test is giving error https://code.sololearn.com/chF60ATvOi9M/?ref=app
4 Antworten
+ 4
It should be "High Five" with capital letters. Try that, if that fails, I will read the whole thing and help you.
+ 2
It works.. thanks Fernando Pozzetti
+ 1
Here you go.
#include <iostream>
using namespace std;
int main() {
int yards;
cin>>yards;
if(yards<1){
cout<<("shh");
}else if(yards>10){
cout<<("High Five");
}else{
for(int x=0;x<yards;x++){
cout<<("Ra!");
}
}
return 0;
}
0
You can also try this:
#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;
}