Submission
Status:
PPTTTTTTTT
Subtask/Task Score:
20/100
Score: 20
User: bananakung
Problemset: Strobogrammatic Numbers
Language: cpp
Time: 1.099 second
Submitted On: 2026-09-20 13:12:12
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
ll s,d,a=1,ct=0;
bool stro=true;
int ans=0;
string n;
cin>>s>>d;
for(ll i=s;i<=d;i++)
{
n=to_string(i);
a++;
stro=true;
int e=n.size();
for(int j=0; j<e;j++)
{
if(n[j]==n[ e-j-1 ]&&(n[j]=='0' || n[j]=='1' || n[j]=='8'))
{
}
else if((n[j]=='6' && n[ e-j-1 ]=='9' ) || (n[j]=='9' && n[ e-j-1 ]=='6' ))
{
}
else
{
stro=false;
break;
}
}
if(stro==true)
{
// cout<<n[i]<<" ";
ans++;
}
}
//to_string()
cout<<ans;
}