Problem Link: CodeChef: Practical coding for everyone
Learning course: Solve Programming problems using C
My code
// Update the code below to solve this problem
#include <stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int P;
scanf("%d",&P);
int P1 = P / 100;
int P2 = (P%100)+1;
if(P<=10){
printf("%d\n",&P);
}
else if(P>=11 && P%100==0){
printf("%d\n",&P1);
}
else if(P%100!=0 && P%100<10){
printf("%d\n",&P2);
}
else{
printf("-1\n");
}
}
return 0;
}