题目1054:字符串内排序

来源:互联网 发布:域名污染 还能用吗 编辑:程序博客网 时间:2024/06/05 14:28
#include<iostream>//下文中用了strlen()函数,在vc6.0中不添加<string.h>编译正常,//但是在九度上不加会complie Error#include<string.h>#include<algorithm>using namespace std;//全局变量char str[200];int main(){while(cin >> str){sort(str,str+strlen(str));cout << str << endl;}return 0;}

0 0
原创粉丝点击