Sstc MOBNUM editorial

question link => What is your mobile number | CodeChef

solution :-

#include
using namespace std;
int main(){
int t ;
cin>>t;
while(t-- !=0){
string s;
cin>>s;
bool b =0;
if(s[0] == ‘0’ || s.length() != 10){
b = 1;
}
else{
for(int i=0;i<s.length();i++){
if(isdigit(s[i]) == false){
b = 1;
break;
}
}}
if(b){cout<<“NO”<<endl;}
else{cout<<“YES”<<endl;}
}

return 0;
}