chef and polygon cakes why this code giving wrong answer

int main()
int t,n,a,k,d,s;
scanf("%d %d %d",&n,&a,&k);
printf("%d 1",s);

Your code can be displayed much more nicely, including showing the characters that are misinterpreted as format commands above, by highlighting it in the editor and pressing the code format button in the editor toolbar:

alt text

This indents the whole block to allow interpretation as literal text, including preserving code indents.

You could also link to the code, as there for example using [link to](

On the actual coding issue, you should re-read the output requirements. The request is for the numerator and denominator of a fraction that evaluates exactly to the angle in question, which may be non-integer. If the request had been for the angle directly to some precision, you should have had d and s as floats etc…

1 Like