<img src="http://img.blog.csdn.net/20140626095740421?
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveG1oMTk1NA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast” alt=””>
源程序:
#include<iostream> #include<string> using namespace std; //const int max=1024; int main) { char s[1024]; char temp; getss); int len; len=strlens); forint i=0;i<len;i++) { forint j=i+1;j<len;j++) { ifs[i]>s[j]) { temp=s[i];s[i]=s[j];s[j]=temp; } } } putss); return 0; }
执行结果:
<img src="http://img.blog.csdn.net/20140626100016781?
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveG1oMTk1NA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast” alt=””>
总结:非常easy~0基地称号~
版权声明:本文博客原创文章,博客,未经同意,不得转载。