Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
45530 | Songgy_King | 回文数 | C++ | Accepted | 0 MS | 252 KB | 375 | 2024-04-14 20:31:05 |
#include<bits/stdc++.h> using namespace std; int huiwen(int n){ int a=n,b=0; while(n){ b=b*10+n%10; n/=10; } return a==b; } int check(int n){ while(n){ if(n%10==7) return 1; n/=10; } return 0; } int main() { int a,b,cnt=0; cin>>a>>b; for(int i=1;i<=b;i++){ if(huiwen(i)&&check(i)) cnt++; } cout<<cnt; return 0; }