Problem Code:ACS, Contest Code:[JUNE222]
Difficulty Rating:739.
FOR THE GIVEN PROBLEM, following is the code i wrote. Even though my code satisfies all the test cases, it still shows wrong answer in sub-task #2. I don’t understand what went wrong. Please help.
Help me find the fault in my code.
include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>> t;
while(t–){
int p;
cin>> p;
if(p<=10 && p>=0)
cout<< p<< endl;
else if(p>=100 && p%100<10)
cout<< p/100 + p%100 << endl;
else
cout<< -1 <<endl;
}
}