C++ 字符串去重排序实例代码
入一个字符串,去掉重复出现的字符,并把剩余的字符串排序输出。
实现代码:
#include
#include
using namespace std;
void sort(string s)
{
char tmp[100];
int len=s.size();
int count=0,i,j;
for (i=0;i<len;i++)
{
for (j=i+1;j<len;j++)
{
if (s[i]==
本文实例讲述了Python实现对文件进行单词划分并去重排序操作。分享给大家供大家参考,具体如下:
文件名:test1.txt
文件内容:
But soft what light through yonder window breaks
It is the east and Juliet is the sun
Arise fair sun and kill the envious moon
Who is already sick and pale with grief
样例输出:
Enter