poj 1316 Self Numbers
来源:互联网 发布:模拟人生4帅哥捏脸数据 编辑:程序博客网 时间:2024/06/10 05:39
#include <iostream> #include <memory.h>using namespace std;int self_number[100000];//刚开始的时候,因为数组开得太小了,贡献了3次RE,惨!因为它的相加之和会大于10000的! int main(){ int i, tmp, ans; memset(self_number, 0, sizeof(self_number)); for (i = 1; i <= 10000; i++) { tmp = i; ans = 0; ans += tmp; while (tmp) { int t = tmp % 10; ans += t; tmp /= 10; } if (self_number[ans] == 0) self_number[ans] = 1; } for (i = 1; i <= 10000; i++) if (self_number[i] == 0) cout << i << endl; system("pause");}
- POJ 1316 Self Numbers
- POJ 1316 Self Numbers
- poj 1316 Self Numbers
- POJ 1316 Self Numbers
- POJ 1316 Self Numbers
- poj 1316 Self Numbers
- POJ 1316 Self Numbers
- POJ 1316 Self Numbers
- Self Numbers (poj 1316)
- POJ 1316 Self Numbers
- POJ 1316 Self Numbers
- Self Numbers(POJ--1316
- Self Numbers POJ 1316
- poj 1316 Self Numbers
- Poj 1316 Self Numbers(水题)
- Self Numbers - POJ 1316 水题
- [1316]Self Numbers (水题)POJ
- POJ 1316 Self Numbers 笔记
- boost::mutex vs boost::recursive_mutex
- SQL为字段添加一个唯一约束
- HRBEU/HEUOJ----1002 A Star not a Tree?
- VS2008 stack overflow
- 屏蔽siverlight的右键
- poj 1316 Self Numbers
- memcpy 和 memmove 的区别,memcpy 和 strcpy 的区别
- Excel导入数据库过程中遇到的问题
- 5_28_天天向上
- 5_29_天天向上
- 我的第一个板子--8个LED灯轮回显示
- Android 中组件的显示与隐藏
- javascript:void(0);
- 经典算法研究:模式匹配(子串匹配)之 BM 算法(C语言实现版)初版