阅读下面的程序,运行结果是()。
main()
{
char *str="ABCabcd";
bubble(str,5);
printf("\n%s",str);
}
bubble(str,count)
char *str;
int count;
{
int i,j=count;
char tmp;
while(j-->1)
for(i=0;i<j;i++)
if(str[i]<str[i+1])
{
tmp=str[i]
欢迎免费使用小程序搜题/刷题/查看解析,提升学历,成考自考报名,论文代写、论文查重请加客服微信skr-web
阅读下面的程序,运行结果是()。
main()
{
char *str="ABCabcd";
bubble(str,5);
printf("\n%s",str);
}
bubble(str,count)
char *str;
int count;
{
int i,j=count;
char tmp;
while(j-->1)
for(i=0;i<j;i++)
if(str[i]<str[i+1])
{
tmp=str[i];
str[i]=str[i+1];
str[i+1]=tmp;
}
}
A.bacdCBA
B.baCBAcd
C.cdbaCBA
D.bCBAacd
正确答案B
×
提示:小程序已经收录此题,请在小程序查看名师解析。翰林刷小程序提供搜题,刷题,助你轻松通过考试