标签:int pre string begin const 最好 argc stream .cpp
//
// main.cpp
// ex10_4
//
// Created by a007 on 17/12/1.
// Copyright ? 2017年 a007. All rights reserved.
//
#include <iostream>
#include <algorithm>
using namespace std;
int main(int argc, const char * argv[]) {
string s;
cout << "Enter a string s: ";
cin >> s;
sort(begin(s), end(s));
cout << s << endl;
return 0;
}
这段程序偷懒用了标准算法库函数sort,不过最好还是自己手工实现一遍,加深理解。
标签:int pre string begin const 最好 argc stream .cpp
原文地址:http://www.cnblogs.com/mocuishle/p/7944969.html