单项选择题
下面程序的功能是从键盘输入一个字符串,编程将其字符顺序颠倒后重新存放,并输出这个字符串。程序的运行结果如下:Input a string:abcdef↙The inversed string is:fedcba按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#includestdio.h #includestring.h voidInverse(char*pStr); intmain() { charstr[80]; printf(Inputastring:); gets(str);//输入字符串 Inverse(str);//将存于str数组中的字符串逆序存放 printf(Theinversedstringis:); puts(str);//输出字符串 return0; } voidInverse(char*pStr) { intlen=0; chartemp; char*pStart=pStr;//指针变量pStart指向字符串的第一个字符 char*pEnd;//指针变量pEnd指向字符串的最后一个字符 for(;*pStart!='\0';_________)//求出字符串长度 { len++; } for(pStart=pStr,___________;pStartpEnd;pStart++,pEnd--) { temp=_________; ________________; *pEnd=temp; } }
A、第21行: pStart++第25行: pEnd=pStr+len-1第27行: *pStart第28行: *pStart = *pEnd
B、第21行: *pStart++第25行: pEnd=pStr+len第27行: *pStart第28行: *pStart = *pEnd
C、第21行: pStart++第25行: pEnd=pStr+len-1第27行: pStart第28行: pStart = pEnd
D、第21行: *pStart++第25行: pEnd=pStr+len第27行: pStart第28行: pStart = pEnd
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
06210041:以下不正确的数组定义语句是( )。
A.double x[5]={2.0, 4.0, 6.0, 8.0, 10.0};
B.int y[5]={0, 1, 3, 5, 7, 9};
C.char ch1[ ]={'1', '2', '3', '4', '5'};
D.char ch2[ ]={'\x10', '\xa', '\x8'};
点击查看答案
单项选择题
d{3,8}表示5个数字。( )A.对B.错
点击查看答案
相关试题
《我的四个假想敌》的主题是父爱。
以下哪个字符在字符串输出时能起到换行的作...
在进行C语言程序编译时,下面( )符号后...
清场不包括
下列叙述不正确的是 A. Scopolamine分子...