Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <utility>
- using namespace std;
- pair<int, int> F(int x) {
- int a = 0, b = 0;
- while (x>0) {
- a++;
- b += x % 100;
- x /= 100;
- }
- return make_pair(a, b);
- }
- int main() {
- for (int w = 9999; w > 0; w--) {
- if (F(w) == make_pair(2, 17)) {
- cout << w;
- break;
- }
- }
- return 0;
- }
RAW Paste Data