字母串按照字典序排序

//字典序,编译环境 Dev-C++
#include <iostream>
using namespace std;
#include<algorithm>

int main()
{
    
    
	string str="PumasAreLarge";
	
	sort(str.begin(),str.end());

	for(int i=0;i<str.length();i++)
		printf("%c",str[i]);
	return 0;
} 

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_51336041/article/details/121451489
今日推荐