0

I am getting 4 test correct .5th test not getting plz can you help anyone. This program is for Jungle Camping

#include <iostream> #include <string> using namespace std; int main() { int i; string a, b, c ,d, sounds[5]; a="Grr"; b="Rawr"; c="Ssss"; d="Chirp"; cin>>sounds [0]; cin>>sounds [1]; cin>>sounds [2]; cin>>sounds [3]; for(i=0;i<4;i++) { if(sounds [i]==a) cout <<"Lion "; if(sounds [i]==b) cout <<"Tiger "; if(sounds [i]==c) cout <<"Snake "; if(sounds [i]==d) cout <<"Bird "; } return 0; }

1st Jan 2020, 7:22 AM
Vishwesh Patel
Vishwesh Patel - avatar
1 Antwort
+ 2
Inputs could be more than 4 like : Grr Rawr Ssss Ssss Chirp Chirp
1st Jan 2020, 8:13 AM
Daljeet Singh
Daljeet Singh - avatar