Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
45531 | jiabokai | 回文数 | C++ | Accepted | 0 MS | 252 KB | 401 | 2024-04-14 20:31:06 |
#include<bits/stdc++.h> using namespace std; bool palindrome(int n){ int a=n,b=0; while(n){ b=b*10+n%10; n/=10; } return a==b; } bool includ(int m){ while(m){ if(m%10==7){ return true; } m/=10; } return false; } int main(){ int a,b,cnt=0; cin>>a>>b; for(int i=a;i<=b;i++){ if(palindrome(i)&&includ(i)){ cnt++; } } cout<<cnt; return 0; }