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.
6 Respuestas
+ 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
+ 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
+ 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 🤣
+ 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.
+ 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 😊🤙