Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
45534 | sunhuifeng | 回文数 | C++ | Accepted | 0 MS | 244 KB | 346 | 2024-04-14 20:33:23 |
#include<iostream> using namespace std; int hw(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=a;i<=b;i++){ if(hw(i)&&check(i)) cnt++; } cout<<cnt; return 0; }