填空题

下面程序的输出结果是 【12】 。 char b[]="ABCD"; main() { char *p=b; for(;*p;p++) printf("%s",p); printf("\n"); }

【参考答案】

ABCDBCDCDD
<上一题 目录 下一题>
热门 试题

填空题
下面程序中函数creat用于建立一个带头结点的单向链表,新产生的结点总是插在链表的末尾,单向链表的头指针作为函数值返回。将程序补充完整。#include<stdiao.h>struct list{char data; struct list * next;};struct list * creat(){struct list *h,*p,*q; char ch;h= 【18】 malloc(sizeof(struct list));p=q=h;ch=getchar();while(ch!=’’){p= 【19】 malloc(sizeof(struct list));p->data=ch;q->next=p;q=p;ch=getchar();}p->next=’ 0’;【20】 ;}
填空题
以下程序的功能是从键盘上输入一行字符,存入一个字符数组中,然后输出该字符串。请填空。main(){ char str[81],*sptr;int i;for(i=0;i<80;i++){ str[i]=getchar();if(str[i]==’ n’)break;}str[i]= 【10】 ;sptr=str1while(* sptr)putchar(* sptr 【11】 );}
相关试题
  • 以下程序调用随机函数得到N个20以内的整...