+ 2

Code coach : cheer creator

My third test is giving error https://code.sololearn.com/chF60ATvOi9M/?ref=app

11th Jan 2020, 6:09 AM
Lukesh Singla
Lukesh Singla - avatar
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.
11th Jan 2020, 6:39 AM
Fernando Pozzetti
Fernando Pozzetti - avatar
+ 2
It works.. thanks Fernando Pozzetti
11th Jan 2020, 7:05 AM
Lukesh Singla
Lukesh Singla - avatar
+ 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; }
21st Apr 2021, 7:41 AM
Joe Hutchens
Joe Hutchens - avatar
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; }
15th Jan 2020, 7:04 PM
Peter
Peter - avatar