sicily 1325. Digit Generator
来源:互联网 发布:while it is always 编辑:程序博客网 时间:2024/05/18 05:19
#include <iostream>using namespace std;int main(){int caseNum;cin >> caseNum;while(caseNum--){int number;cin >> number;int count = 0, temp = number;while (temp > 0)//计算出输入的数字的位数{temp /= 10;count++;}int n = number - count * 10;//一个generator数与原数相差最大不过它的位数乘以10while (n < number)//逐渐枚举出符合条件的数{int m = n;int sum = 0;while (n > 0){sum += n % 10;n = n / 10;}sum += m;if (sum == number){cout << m << endl;break;}n = m + 1;if (n == number)cout << 0 << endl;}}return 0;}
0 0
- sicily--1325. Digit Generator
- sicily 1325. Digit Generator
- Sicily 1325. Digit Generator
- [sicily]1325. Digit Generator
- sicily 1325. Digit Generator
- Sicily 1325. Digit Generator
- 1325. Digit Generator
- Digit Generator
- Digit Generator
- Sicily 4315. Digit Count
- Sicily 7969. Digit Sum
- Digit Generator 打表
- UVa1583 - Digit Generator
- 2502. Digit Generator
- UVA-1583 - Digit Generator
- UVa 1583 Digit Generator
- UVa 1583 - Digit Generator
- UVA1583 - Digit Generator
- Java 7之基础类型第6篇 - Java可变字符串类型
- 安装opensips/CP的命令过程
- Vim去除重复行
- java面向对象(一)
- 1077:美丽数
- sicily 1325. Digit Generator
- 算法——bing字典问题
- 2013走了,2014来了
- 1076:猜数字
- ARM中C和汇编混合编程及示例
- 帧差法、光流法、背景减除法
- Android平台定义的主题样式:
- 绕过https下载aosp代码
- 1086:大数取模