+ 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; }
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!"
0
You are closer
to the right answer
Just review the structure of all conditions
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;
}