Reprint please specify the source [ametake All rights reserved]http://blog.csdn.net/ametake Welcome to see
Valley 1107 Max Integer
Address: http://www.luogu.org/problem/show?pid=1107
Topic Description Narrationthere are n positive integers (n<=20), which are concatenated into a row to form the largest multi-bit integer.
For Example: n=3, 3 integers 13, 312, 343 are concatenated into the largest integer: 34331213
also such as: n=4, 4 integer 7,13,4,246 concatenated into the largest integer is: 7424613Input/output formatInput Format:
N
N Number
output Format:
Number of multiple digits connected
Input and output examplesInput Example #:
313 312 34347 13 4 246
Output Example #:
343312137424613
Let's see how it works, I'm not throwing up. The problem of the layout of a drama is sad, it is not flattering
This topic was originally used for search or greed? In short I hung countless times ... Then read a man's explanation to find the choice of sort is an artifact = = but I don't believe it. So the unauthorized attempt to bubble sort = = even though the bubble sort I wrote wrong But after all it was wrong, the real bubble is not correct.
Bubbling may not be correct because the bubble puts the biggest back and the sorting is really powerless to try ...
In fact the principle is very easy. is to put two strings together in a row opposite the order of the largest number of the 22 comparison
Code ~
-Joys and sorrows are always ruthless. One order before the drip to the dawn.
"Everyday Learning" "Search/Sort + string" 1012/1107 maximum integer