+ 3
[C language] What's wrong with my code?
Every output have two number. I don't know how to find the second number. Please help me. (I put the question in code source because description box is not enough) i put my code too. https://code.sololearn.com/cMXb1GRd5WCR/?ref=app https://code.sololearn.com/cdI0tmoWxKe6/?ref=app
15 Respostas
+ 1
It's you again... This was once my friend's test and I solved it. I suggest you try it first BEFORE you take a look on my solution.
https://code.sololearn.com/cSoG9xd5Y2lo/?ref=app
+ 2
Navya Sri okay.. Thankyou so much
+ 2
Navya Sri I understand, thank you
+ 1
You can just counting with if(n==3 || n==4) and store it in a variable passed by pointer
+ 1
Briana I don't have much idea about C language. but I can understand that problem. so pls read that ..
https://code.sololearn.com/c0ac1sY68SHa/?ref=app
+ 1
Briana that second ouput number depends upon total number of calls for F(3) and F(4).
+ 1
Briana Welcome
R U Understand..?
0
CarrieForle I ask for the second case output. Like.. the firt case example, why the second number is 0?
0
You mean 2 as input?
0
CarrieForle yes.. 2 as an input have two number output, those are 6 and 0. 6 is gotten from F(2), but where does output 0 come from?
0
LastSecond959 thankyou
0
LastSecond959 can i ask? Why the online judge say my cide wrong answer? Do you know what's wrong with my code?
https://code.sololearn.com/csnAKBGTBXJ1/?ref=app
0
*code
0
Briana First of all, constraints is just the limits of the input(s) that will be tested by the OJ, so you don't have to do if (t>=1 && t<=20) and the other same ifs. Line 25 & 29. And our college OJ is kinda retarded so... might want to change that part.
Second, you don't need line 10-13 since you returned it on line 7.
0
LastSecond959 it still doesn't work. Idk.. This OJ make me so confused huhh