#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; using ll=long long; int res; bool check(int n) { int x=n; while(x>0) { int y=x%10; if(y==2||y==0||y==1||y==9) { return true; } else x/=10; } return false; } int main() { int n;cin>>n; for(int i=1;i<=n;i++) { if(check(i))res+=i; } cout<<res; return 0; }
0.0分
2 人评分
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:698 |
点我有惊喜!你懂得!浏览:2074 |
C二级辅导-等差数列 (C语言代码)浏览:591 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:623 |
C语言训练-求s=a+aa+aaa+aaaa+aa...a的值 (C语言代码)浏览:591 |
奖学金 (C++代码)浏览:2008 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:775 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:687 |
WU-拆分位数 (C++代码)浏览:788 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:902 |