Help me in solving LBC21 problem

My issue

what is the wrong my code

My code

// Update the code below to solve this problem

#include <iostream>
#include <string>
using namespace std;

int main() 
{
  int t;
  cin>>t; 
  while(t--)
  {
  int P;
  cin>>P;
  if(P>=100){
      cout<<(P/100)+(P%100)<<endl;
  }
 
  else{
      cout<<(P/1)+(P%1)<<endl;
  } 
 
   }
return 0;
}

Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone

1 Like

your logic is not right.
The logic is :-
if(p/100 + p %100 <=10)
print p/100 + p%100;
else
print -1;