Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int F(int x) {
- int L = 0;
- int M = 0;
- while (x > 0) {
- L = L + 1;
- if(M < x) {
- M = x % 10;
- }
- x = x / 10;
- }
- return L * 10 + M;
- }
- int main() {
- for (int w = 999; w > 0; w--) {
- if (F(w) == 37) {
- cout << w;
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement