0

Solving Jungle Camping in C

I am struggling finding the solution for this exercise. I solved case 1,2, and 4 but not 3 and 5 (can't see why, because they're locked). The code Is the following one.

25th Mar 2021, 10:55 AM
Cristopher Ricciotti
Cristopher Ricciotti - avatar
6 ответов
+ 3
If I'm not wrong, facile() returns the number of appearance of each noise, and stampa() prints the animals volte times. Counting won't work in this question because the order of the output depends on the order of the input. Input "Ssss Grr Ssss Grr", your code outputs Lion Lion Snake Snake while the correct one is: Lion Snake Lion Snake
25th Mar 2021, 11:12 AM
你知道規則,我也是
你知道規則,我也是 - avatar
+ 1
if you notice, each animal sound starts with a different letter. you could scan off each animal noise, and use a switch to comapre the first character. If it has a specific character, print out the parellel animal
25th Mar 2021, 11:00 AM
Slick
Slick - avatar
+ 1
Thanks, I really appreciate, but i'd like to find what's wrong in my code, since i worked on writing my own function for like 2 weeks 🤣
25th Mar 2021, 11:03 AM
Cristopher Ricciotti
Cristopher Ricciotti - avatar
+ 1
No worries, its some of the base logic that seems to be wrong. After you get your input, you pass it through all those functions. But is it the same amount of input each time? What happens if one of the noises is read before it should be? I'm just not too sure about how or why you're doing it this way. Thats why i gave the suggestion.
25th Mar 2021, 11:12 AM
Slick
Slick - avatar
+ 1
Oh here Is It 🤗 let's Say It was a test. I want to be able to write a function instead of Just using the string.h ones. Thanks both 😊🤙
25th Mar 2021, 11:22 AM
Cristopher Ricciotti
Cristopher Ricciotti - avatar
25th Mar 2021, 10:57 AM
Cristopher Ricciotti
Cristopher Ricciotti - avatar