#include
voidfun(chars[])
{
chart;
inti,j;
for(i=0;s[i]!='\0';i++)
for(j=i+1;s[j]!='\0';j++)
{
if(s[i]>='0'&&s[i]<='9')
{
if(s[j]<'0'||s[j]>'9')
{
t=s[i];
s[i]=s[j];
s[j]=t;
}
}
}
}
intmain()
{
chars[80]="def35adh3kjsdf7";
printf("\ntheoriginalstringis:%s\n",s);
fun(s);
printf("\ntheresultis:%s\n",s);
return0;
}
扩展资料
puts(字符数组名)功能:把字符数组中的字符串输出到显示器
#include"stdio.h"
main()
{
staticcharc[]="BASIC\ndBASE";
puts(c);
}
staticcharc[]="BASIC\ndBASE";
puts(c);