ASCII-code Ordering
Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 103963 Accepted Submission (s): 43442
Problem description Input Three characters, the ASCII code of each character is printed in order from small to large to output these three characters.
Input data has more than one group, each of which consists of three characters and no spaces between them.
Output for each set of input data, one line is printed, and the characters are separated by a space.
Sample Input
Qweasdzxc
Sample Output
e q wa d SC x z
Authorlcy Alas again to the last year to do water problems. The last year was a 2 start serial number. This year re-a it again. By the way, record the answer here. At the same time, I would like to compare two different times to do the same problem feeling. Isn't it simple?
#include <iostream> #include <algorithm>using namespace Std;int main () {char ls[4];while (cin>>ls[0] >>ls[1]>>ls[2] {sort (ls,ls+3);cout<<ls[0]<< "" <<ls[1]<< "" <<ls[2]< <endl;} return 0;}
Hangzhou Electric HDU ACM ASCII code sequencing