没啥可说的了,这题也能当提高题?
参考代码:
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<cmath> #include<vector> #include<set> #include<sstream> #include<cstring> #include<utility> using namespace std; typedef long long ll; typedef long l; const int N=1<<20; int n; int main(){ cin>>n; ll z=0; for(int i=1;i<=n;i++){ int x=i; while(x!=0){ int f=x%10; if(f==2||f==0||f==1||f==9){ z+=i; break; } x/=10; } } cout<<z; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1293 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:472 |
完数 (C语言代码)浏览:693 |
printf基础练习2 (C语言代码)浏览:618 |
字符串输入输出函数 (C语言代码)浏览:2495 |
字符串比较 (C语言代码)浏览:685 |
输出九九乘法表 (C语言代码)浏览:1048 |
整数平均值 (C语言代码)浏览:786 |
母牛的故事 (C语言代码)浏览:479 |
1074(纳闷了,答案错误,求指教)浏览:362 |