地址
http://acm.hdu.edu.cn/showproblem.php?pid=2000
定位
字典排序
水题
分析
- 直接使用 C++ 标准库中的 sort() 进行字典排序
代码
- #include <iostream>
- #include <algorithm>
- #include <stdio.h>
- #include <string.h>
- using namespace std;
- int main() {
- char ch[3];
- while(scanf(“%s”,ch)!=EOF) {
- sort(ch,ch+3,less<char>());
- printf(”%c %c %c\n”,ch[0],ch[1],ch[2]);
- }
- return 0;
- }
性能
Exe.Time | Exe.Memory | Code Length | Language |
---|---|---|---|
0MS | 1868K | 286B | c++ |