当前位置:网站首页>Huawei 0 foundation - image sorting

Huawei 0 foundation - image sorting

2022-07-06 18:25:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm the king of the whole stack .

Source program :

#include<iostream>
#include<string>
using namespace std;

//const int max=1024;

int main()
{
	char s[1024];
	char temp;
	gets(s);
	int len;
	len=strlen(s);
	for(int i=0;i<len;i++)
	{
		for(int j=i+1;j<len;j++)
		{
			if(s[i]>s[j])
			{
				temp=s[i];s[i]=s[j];s[j]=temp;
			}			
		}
	}
	puts(s);
	return 0;
}

Execution results :

summary : very easy~0 Base title ~

Copyright notice : This article is an original blog article , Blog , Without consent , Shall not be reproduced .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/117396.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061018309747.html