當前位置:編程學習大全網 - 網站源碼 - Iu商城源代碼

Iu商城源代碼

程序

# include & ltstdio.h & gt

# include & ltstring.h & gt

void排序(char *str)

{ int i,j;

char c;

for(I = 0;我& ltstrlen(str)-1;i++)

for(j = I+1;j & ltstrlen(str);j++)

if(str[I]& lt;str[j])

{ c = str[I];str[I]= str[j];str[j]= c;}

}

void main()

{ char s[256];

Printf("請輸入最多255個字符的字符串:");scanf("%s ",s);

排序;

Printf("排序結果:%s\n ",s);

}

運行結果

請輸入最多255個字符的字符串:abioqujakdncuiyewqrjklvjlduiaoior。

排序後的結果:ywvuuururqoonllkkjjiiiieddcbaaa

  • 上一篇:有人用python寫過ldap的登錄和修改密碼嗎
  • 下一篇:濰坊長大壹宿舍小區周邊設施怎麽樣?
  • copyright 2024編程學習大全網