Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void func(char *str)
- {
- static int max_value = 0;
- if (*str)
- {
- if (*str - '0' > max_value)
- max_value = *str - '0';
- str++;
- func(str);
- }
- else std::cout << max_value << std::endl;
- }
- int main()
- {
- func("241881");
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement