MUFFINS3 Wrong answer

#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[])
{
// insert code here…
double testcase =0,i=0;
scanf("%d",&testcase);
for (i=0; i<testcase; i++)
{
double N=0;
scanf("%lf",&N);
printf("%d",(int)N/2+1);
}

     return 0;
}

Why do i get wrong answer for the following code?

1 Like

you’re missing ‘\n’ after every print statement and you are also taking double testcase as %d in input, just change testcase to int and add new line after each print statement.

Thanks a lot,how did you know this? i mean i never thought it could be the reason,is there any way to see why i receive the wrong answer

just look through your code carefully and remember those points where you would possibly make mistake.

//