题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-12-23 01:36:40

[填空题]以下程序段用以统计链表中元素的个数。其中first指向链表第一个结点,count用来统计结点个数。请填空。   struct link   { char data;    struct link * next;   }   struct link * p,* first;   |   int count=0;   p=first;   while( 【17】 )   {    【18】 ;   p= 【19】 ;   }

更多"以下程序段用以统计链表中元素的个数。其中first指向链表第一个结点,"的相关试题:

[填空题]以下程序段的功能是统计链表中结点的个数,其中first为指向第一个结点的指针(链表带头结点)。请在下划线内填入正确内容。 struct link { char data; struct link*next;}; … struct link*p,*first; int c=0; p=first; while( 【19】 ) { c++; p= 【20】 ;}
[填空题]以下程序段用于构成一个简单的单向链表。请填空。
struet STRU
int x,y;
float rate;
【14】 p;
a,b;
a.x=0; a.y=0;a.rate=0;a.p=&b;
b.x=0;b.y=0;b.rate=0;b.p=NULL;
[单项选择] First Impressions Count Traditionally uniforms were-and for some industries still are-manufactured to protect the worker. When they were first designed, it is also likely that all uniforms made symbolic sense-those for the military, for example, were originally intended to impress and even terrify the enemy; other uniforms denoted a hierarchy-chefs wore white because they worked with flour, but the main chef wore a black hat to show he supervised. The last 30 years, however, have seen an increasing emphasis on their role in projecting the image of an organization and in uniting the workforce into a homogeneous unit-particularly in ’’customer facing’’ industries, and especially in financial services and retailing. From uniforms and workwear has emerged ’’ corporate clothing’’. "The people you employ are your ambassadors," says Peter Griffin, managing director of a major retailer in the UK. "What they say, how they look, and how they behave is terrib
A. Y
B. N
C. NG
[单项选择]以下正确的程序段是
A. char str1[]="12345",str2[]="abcdef";
B. char str[10],*st="abcde";strcat(str,st);
C. charstr[10]=" "。*st="abcde";strcat(str,st);
D. char*st1="12345",*st2="abcde";strcat(st1,st2);
[单项选择]设变量已正确定义,以下不能统计出一行中输入字符个数(不包含回车符)的程序段是()
A. n=0; while(( ch=getchar())!='/n') n++;
B. n=0; while( getchar()! ='/n') n++;
C. for( n=0; getehar()!='/n'; n++);
D. n=0; for( ch=getchar(); ch!='/n'; n++);
[填空题]

以下程序创建-个链表并实现数据统计功能。函数WORD *create(char a[][20],int n)创建-个包含n个结点的单向链表,结点数据来自a指向的数组中存储的n个单词(字符串)。函数void count(WORD *h)统计h指向的单向链表中不同单词各自出现的次数,将统计结果保存到局部数组c中并输出。程序运行时输出结果为"red:1 green:2 blue:3"试完善程序以达到要求的功能。
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
typedef struct w
{char word[20];
struct w *next:
}WORD;
WORD *create(char a[][20],int n)
{WORD *p1,*p2,*h=0;int i;
for(i=0;i {p1=(WORD *)malloc(sizeof(WORD));
strcpy((),a[i]);
if(h==O)
h=p2=p1:
else
{p2->next=p1;p2=pl;}
}
p2->next=();
return h;
}
void count(WORD *h)
{ struct
{char word[20];
int num;
}c[6]={0};
int m=0,i;
while(h)
{if(m==O)
{strcpy(c[0].word,h->word);
c[0].num=1;m++;
}
else
{for(i=O;i if(strcmp(c[i].word,h->word)==0)
{ () ;
break;
}

[单项选择]以下程序段完全正确的是
A. int *p; scanf("%d", &p);
B. int *p; scanf("%d", p);
C. int k,*p=&k;scanf("%d",p);
D. int k,*p; *p= &k; scanf("%d",p);

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码