首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> main() void fun(char*t,char*s) {char ss[10]="acc",aa[10]="bbxxyy"; {while(*t!=0)t++; fun(ss,aa);print
有以下程序 #include<stdio.h> main() void fun(char*t,char*s) {char ss[10]="acc",aa[10]="bbxxyy"; {while(*t!=0)t++; fun(ss,aa);print
admin
2016-12-18
30
问题
有以下程序
#include<stdio.h> main()
void fun(char*t,char*s) {char ss[10]="acc",aa[10]="bbxxyy";
{while(*t!=0)t++; fun(ss,aa);printf("%s,%s\n",ss,aa);
while((*t++=*s++)!=0);} }
程序的运行结果是
选项
A、acc,bbxxyy
B、accxxyy,bbxxyy
C、accbbxxyy,bbxxyy
D、accxyy,bbxxyy
答案
C
解析
fun函数中,第1个while循环语句使指针t指向字符串的末尾,第2个while循环语句实现了字符串t和s的连接。主函数中语句fun(ss,aa)的功能是将字符串aa连接到字符串ss的末尾。
转载请注明原文地址:https://kaotiyun.com/show/SyDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序,程序中库函数islower(ch)用以判断ch中的字母是否为小写字母#include#includevoidfun(char*P){inti=0;while(p[i]){if(p
以下程序的输出结果是【】。main(){char*p[]={"BOOL","OPK","H","SP"};inti;for(i=3;i>0;i--,i--)printf("%c",*p[i]);printf(
有以下程序intfun(intn){if(n==1)return1;elsereturn(n+fun(n-1));}main(){intx;scanf("%d",&x);x=fun(x);pri
有定义语句:chars[10];,若要从终端给s输入5个字符,错误的输入语句是
若变量已正确定义,有以下程序段i=0;doprintf("%d,",i);while(i++);printf("%d\n",i);其输出结果是
下面各选项中,均是C语言合法标识符的选项组是
主程序调用findmax函数求出数组中最大元素在数组中的下标,括号中需填写的内容是#includefindmax(int*s,intt,int*k){intp;for(p=0,*k=p;ps[*k])();}ma
有三个关系R、S和T如下:由关系R和S通过运算得到关系T,则所使用的运算为
以下程序中函数f的功能是在数组x的n个数(假定n个数互不相同)中找出最大最小数,将其中最小的数与第一个数对换,把最大的数与最后一个数对换。请填空。#includevoidf(intx[],intn){intp0,p1,i,j
在E-R图中,用()来表示实体之间联系。
随机试题
根据《公安机关督察条例》,督察机构在现场督察中发现公安机关的人民警察违法违纪,必要时可以带离现场的情形有()。
冲突管理中合作策略的基本观点包括()
图示结构Mc影响线已作出,如图所示,其中竖标yE是()。
肺气肿患者不具有下列哪项体征
纤溶活性增强的筛选试验
下列关于沥青密度与相对密度试验的说法,请回答以下问题。试验所涉及的主要仪器与材料有()。
平面控制网布设的原则不包括( )。
该公司进口环节应缴纳的关税、消费税、增值税合计为( )。该公司加工环节应代扣代缴的消费税、城市维护建设税和教育费附加总和为( )。
Levy-YeyatiSturzenegger的分类(LYS分类)是基于事实上的分类,它有三个分类变量。下列选项不属于其中的是()。
Itwouldbeinterestingtodiscoverhowmanyyoungpeoplegotouniversitywithoutanyclearideaofwhattheyaregoingtodoa
最新回复
(
0
)