#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语言训练-排序问题<1> (C++代码)浏览:589 |
C语言程序设计教程(第三版)课后习题5.7 (Java代码)浏览:884 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:640 |
剪刀石头布 (C语言代码)浏览:1746 |
WU-printf基础练习2 (C++代码)浏览:1999 |
【绝对值排序】 (C语言代码)浏览:820 |
C语言程序设计教程(第三版)课后习题6.8 (C语言代码)浏览:522 |
C语言程序设计教程(第三版)课后习题9.2 (C语言代码)浏览:555 |
C二级辅导-温度转换 (C语言代码)浏览:540 |
C语言程序设计教程(第三版)课后习题1.5 (C++代码)浏览:403 |