+ 1

Kindly help fix the one last test case!

You are cheering on your favorite team. After each play, if your team got over 10 yards further down the field, you stand up and give your friend a high five. If they don't move forward by at least a yard you stay quiet and say 'shh', and if they move forward 10 yards or less, you say 'Ra!' for every yard that they moved forward in that play. Task Given the number of yards that your team moved forward, output either 'High Five' (for over 10), 'shh' (for <1), or a string that has a 'Ra!' for every yard that they gained. Input Format An integer value that represents the number of yards gained or lost by your team. Output Format A string of the appropriate cheer. Sample Input 3 Sample Output Ra!Ra!Ra! The code goes here, https://code.sololearn.com/c0Qdo3APjhzj/?ref=app

21st Oct 2021, 4:24 PM
Surbhi Yadav
Surbhi Yadav - avatar
9 odpowiedzi
+ 2
Keep code aside You did mistake in printing "High Five" Surbhi Yadav You have written f instead of F in High Five in your code in line 18. Took too much effort to find out this, earlier I was looking for logical/syntax error.
21st Oct 2021, 5:01 PM
Saurabh
Saurabh - avatar
+ 2
Glad that you got it, There is one feature called " mark as best " if you got satisfied with any answer then you can mark is as best! So that other can also find it without any difficulty I am suggesting you because you seems new to discussion section. Regards!!
21st Oct 2021, 5:18 PM
Saurabh
Saurabh - avatar
+ 1
Saurabh Kumar Yadav I did so but it didn't helped!
21st Oct 2021, 4:34 PM
Surbhi Yadav
Surbhi Yadav - avatar
21st Oct 2021, 4:40 PM
Surbhi Yadav
Surbhi Yadav - avatar
+ 1
One more suggestion -: Remove "else" from conditions,(you have written in else-if ladder) Just keep them in if condition...
21st Oct 2021, 4:48 PM
Saurabh
Saurabh - avatar
+ 1
I think it won't make any difference!
21st Oct 2021, 4:51 PM
Surbhi Yadav
Surbhi Yadav - avatar
+ 1
Thanks Saurabh Kumar Yadav! Me too donot wonder about the 'f' and 'F'! 😅
21st Oct 2021, 5:11 PM
Surbhi Yadav
Surbhi Yadav - avatar
0
In line 16 remove the = sign from else if (a>=10) I am saying this by reading the description provided by you, for detailed kindly link the question too in description Surbhi Yadav
21st Oct 2021, 4:32 PM
Saurabh
Saurabh - avatar
0
Use this code #include <iostream> using namespace std; int main() { int valur; cin >>valur ; if(valur >10){cout <<"High Five";}else if(valur <1){cout <<"shh";}else{ for (int i=0;i<valur;i++){ cout <<"Ra!";}} return 0; }
23rd Oct 2021, 3:28 PM
N. Vimukthi Dilshan Fernando