+ 4

When run the code, it show 2 test case failed. Gotham City

#include <iostream> using namespace std; int main() { int criminals ; cin>>criminals ; if (criminals < 5) cout<<"I got this!"; else if (criminals < 11) cout<<"Help me Batman"<<endl; else cout<<" Luck out there!"; return 0; }

12th Apr 2020, 5:05 PM
ekhlas Mohamed Abdallah Mohamed
ekhlas Mohamed Abdallah Mohamed - avatar
3 Antworten
0
Read the question again. You're conditional statement has error. It has 3 conditions- 1) less than 5 2) 5 to 10 3) greater than 10 Also the last conditions result is "Good Luck out there!"
12th Apr 2020, 5:16 PM
Avinesh
Avinesh - avatar
0
You are closer to the right answer Just review the structure of all conditions
12th Apr 2020, 8:26 PM
El babo
El babo - avatar
0
My code: #include <iostream> using namespace std; int main() { int b; cin>>b; if (b<5){ cout << "I got this!"; } if (b>5 && b==10){ cout << "Help me Batman"; } if (b>10){ cout << "Good Luck out there!"; } if (b==5){ cout << "Help me Batman"; } return 0; }
30th Jun 2020, 3:55 PM
Тимофей Орловский