百练_4045:与3和5无关的数
来源:互联网 发布:c语言boolean的用法 编辑:程序博客网 时间:2024/05/18 09:22
一个正整数,如果它能被x整除,或者它的十进制表示法中某个位数上的数字为x,则称其为与x相关的数.现求所有小于等于n(n<300)的与x无关的正整数的平方和.
8
样例输出
134
#include<stdio.h>int main(){int n,i,x,sum=0;scanf("%d",&n);for(i=1;i<=n;i++)if(i%3!=0&&i%5!=0&&(i/10)%10!=3&&(i/10)%10!=5&&i%10!=3&&i%10!=5)sum+=i*i;printf("%d\n",sum);return 0;}
阅读全文
0 0
- 百练_4045:与3和5无关的数
- 百练 4045 与3和5无关的数
- 与3和5无关的数
- 百练 2701 与7无关的数
- 百练_2701:与7无关的数
- 百练_3864:与7无关的数
- poj 4045: 与3和5无关的数
- WIKIOI-1341 与3和5无关的数
- POJ 4045:与3和5无关的数
- 1341 与3和5无关的数
- 与2,3,5无关的数
- OpenJudge百炼习题解答(C++)--题4045:与3和5无关的数
- Algorithm学习笔记 --- 与3和5无关的数(搜索)
- 【codevs 2975】与2,3,5无关的数
- codevs 2975 与2,3,5无关的数
- 与7无关的数
- 与7无关的数
- 与7无关的数
- C语言阶乘level1.0
- FlowLayout遇到的坑
- TNS-12545: Connect failed because target host or object does not exist
- 4. Median of Two Sorted Arrays 详细解答
- Choosing the Right Cisco Compatible SFP Transceivers for Your Network
- 百练_4045:与3和5无关的数
- getParameter获取整数值
- JAVA、C# DES通用加解密
- MySQL5.7.19Win10免安装配置+登录+问题解决
- 百练_4067:回文数字(Palindrome Number)
- Problem 16 Power digit sum
- AR 广告大屏UI界面搭建二
- 可爱小仓鼠代码,放在网页里很可爱
- ORA-00838: Specified value of MEMORY_TARGET is too small