
Write a program that computes the shortest closed route through a set of two-dimensional points.
printf '0, 0\n2, 0\n2, 1\n0, 1\n' | ./route_loop_length | cat -eExpected result
6.00$For your own tracking. Tests grade your code.
printf '0, 0\n3, 4\n' | ./route_loop_length | cat -eExpected result
10.00$Expected files
route_loop_length.cAllowed functions
writesqrtfgetlinefscanfferrorfeoffabsffprintfmalloccallocreallocfreestdinstdoutstderr
Write a program that computes the shortest closed route through a set of two-dimensional points.
printf '0, 0\n2, 0\n2, 1\n0, 1\n' | ./route_loop_length | cat -eExpected result
6.00$For your own tracking. Tests grade your code.
printf '0, 0\n3, 4\n' | ./route_loop_length | cat -eExpected result
10.00$Expected files
route_loop_length.cAllowed functions
writesqrtfgetlinefscanfferrorfeoffabsffprintfmalloccallocreallocfreestdinstdoutstderr
Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.
v0.40: Create exercises. Challenge the community.
Meet Studio →