Kindly help fix the one last test case! | Sololearn: Learn to code for FREE!

+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

cpp

10/21/2021 4:24:11 PM

Surbhi Yadav

9 Answers

New Answer

+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.

+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!!

+1

Saurabh Kumar Yadav I did so but it didn't helped!

+1

Okay!! Saurabh Kumar Yadav

+1

One more suggestion -: Remove "else" from conditions,(you have written in else-if ladder) Just keep them in if condition...

+1

I think it won't make any difference!

+1

Thanks Saurabh Kumar Yadav! Me too donot wonder about the 'f' and 'F'! 😅

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

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; }