题目内容

下面程序段是把从终端读入的一行字符作为字符串放在字符数组中,然后输出,请分析程序填空。int i;char s[80],*p;for(i=0;i<79;i++){s[i]=getchar();if(s[i]=='\n') break;}s[i]=【1】 ;p=【2】 ;while(*p) putchar(*p++);

查看答案
更多问题

设有以下程序片段:char a[ ]="hello!",*p;p=a;printf("%d",*(p+5));执行上面的程序片段后的结果为_____.

下面程序是判断输入的字符串是否是”回文”,(顺读和倒读都一样的字符串,称”回文”,如level)。#include "stdio.h"#include "string.h"main(){char s[81],*p1,*p2;int n;printf("Input a string:");gets(s);n=strlen(s);p1=s;p2=【1】;while (p1

下面程序的运行结果是________。#include "stdio.h"#define SIZE 12main(){char s[SIZE];int i;for (i=0;i

下面程序的运行结果是。#include main(){ char a[80],b[80],*p="aAbcdDefgGH";int i=0,j=0;while (*p!='\0'){ if (*p>='a'&&*p<='z'){a[i]=*p;i++;}else{b[j]=*p;j++;}p++;}a[i]=b[j]='\0';puts(a);puts(b);}

答案查题题库