I think this is correct but somehow it doesn't work, does anyone know why this is? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I think this is correct but somehow it doesn't work, does anyone know why this is?

#include<iostream> using namespace std; int main() { int a; cin>>a; if(a > 10){ cout<<"High five"; } else if (a >=1 && a<=10){ for (int i = 0; i < a; i++) { cout<<"Ra!"; }} else ( cout<<"shh"); } 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!

12th Dec 2020, 9:23 AM
Lidandi Biki
Lidandi Biki - avatar
1 Answer
+ 1
Lidandi Biki Check your spelling. It is "High Five" not "High five"
12th Dec 2020, 9:51 AM
noteve
noteve - avatar