Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46975 | Songgy_King | 回文数 | C++ | Accepted | 0 MS | 252 KB | 392 | 2024-05-09 21:55:22 |
#include<bits/stdc++.h> using namespace std; int Palindrome(int n){ int a=n,b=0; while(n){ b=b*10+n%10; n/=10; } return a==b; } int seven(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(Palindrome(i)&&seven(i)){ cnt++; } } cout<<cnt; return 0; }