My issue
I am not able to understand what this code is lacking.
My code
// Update the code below to solve this problem
#include <stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int P,s=0;
scanf("%d\n",&P);
if(P>=0 && P<=1000)
{
if(P>100)
{
s=P/100;
P=P%100;
if(P>0)
s=s+P;
goto check;
}
if(P>0)
s=s+P;
}
check:
if(P<11)
printf("%d\n",s);
else
printf("-1\n");
}
return 0;
}
Learning course: Solve Programming problems using C
Problem Link: CodeChef: Practical coding for everyone