Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
In C, if the result returned without string terminator some test didn't pass. This might help others. I wasted lot of time before figure that out.
Can somebody tell me why i got error on this test?
i printed values by printf on the screen.
Time: 22ms Passed: 14 Failed: 1
-121
-115
-114
-110
-106
-105
-102
-100
-71
-63
-54
-49
-45
-40
-18
-17
-6
-4
2
8
12
33
60
61
62
76
76
90
93
101
114
120
124
Mean = -6.303030
median = -6.000000
case median > Mean -6.000000 > -6.303030
The expression strcmp(result, expected) == 0 is false.
Return is given by function signature
int* sumFracts(int lst[][2], int row)
and (see functiondotest
in "Sample Tests") this result is freed.ok, tnx.
Hi, i'm beginner. Have a problem when try to return result. I calculated N and D correctly, then i create new array int x[] = {N, D}; and trying to return x;
But it doesn't work, every time i got errors, that returned values are not match with expected. What should i return in this function?
Language C. Tnx)
When you ask for help post a question, not an issue.
Hi, i'm beginner. Have a problem when try to return result. I calculated N and D correctly, then i create new array int x[] = {N, D}; and trying to return x;
But it doesn't work, every time i got errors, that returned values are not match with expected. What should i return in this function?
Language C. Tnx)
This comment is hidden because it contains spoiler information about the solution
You need to have the cmath library to use the 'sqrt' operation. Just add:
#include cmath
to the top of your program and it should fix it. Make sure to put "cmath" in angle brackets too.
This comment is hidden because it contains spoiler information about the solution