Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Given a positive integer ~n~. Let ~S~ be the set of all positive integers formed by the digits of the integer ~n~. The "largest brother" is defined as the largest number in the set ~S~.
Requirement: Given a positive integer ~n~ (~0 \leq n \leq 10^{10^{4}}~). Print the "largest brother" that needs to be found.
Input:
The first line contains the number ~t~ (~1 \leq t \leq 100~) - representing the number of test cases.
The next ~t~ lines, each line contains a positive integer ~n~ (~0 \leq n \leq 10^{10^{4}}~).
Output:
- For each test case, print the required result.
Sample Input
2
1254
3225
Sample Output
5421
5322
Bình luận