题目1036:Old Bill
2013-12-22 15:32
309 查看
#include <iostream> #include <fstream> #include <cstring> using namespace std; int find(int x); int main() { int x, y, z, n; #ifndef ONLINE_JUDGE ifstream cin("d:\\OJ\\uva_in.txt"); #endif // ONLINE_JUDGE while (cin >> n >> x >> y >> z) { int tmp = x * 1000 + y * 100 + z * 10; bool found = false; for (int i = 9; i >= 1; i--) { for (int j = 9; j >= 0; j--) { int sum = i * 10000 + tmp + j; if (sum % n == 0) { cout << i << " " << j << " " << sum / n << endl; i = 1; found = true; break; } } } if (!found) cout << 0 << endl; } return 0; }
相关文章推荐
- 题目1036 Old Bill 九度Online Judge
- 题目1036:Old Bill
- 九度OJ题目1036:Old Bill
- 九度 题目1036:Old Bill
- 九度OnlineJudge之1036:Old Bill
- 九度oj-1036-old bill
- 九度OJ 1036:Old Bill (老比尔) (基础题)
- 九度OJ 1036:Old Bill (老比尔) (基础题)
- 九度OJ 1036:Old Bill
- 九度OJ 1036 Old Bill (模拟)
- 1036.Old Bill
- 题目1036:Old Bill
- 上交复试07年机考题(old bill)
- HDU 1036 Average is not Fast Enough!:题目解答源码
- POJ1694,An Old Stone Game,读懂题目+dfs
- FZU 1150 Farmer Bill's Problem(逻辑推理题目)
- ZOJ 2679 Old Bill
- HDU 1036 Average is not Fast Enough!:题目解答源码
- Old Bill
- ZOJ 2679 Old Bill(数学)