皮皮学,免费搜题
登录
搜题
【简答题】
阅读以下说明、C函数和问题,将解答写入答题纸的对应栏内。 【说明1】 函数test_fl(int m,im n)对整数m、n进行某种运算后返回一个整数值。 【c函数1】 int test_f1 (int m,int n) { int k; k=m>n?m:n; for(; (k%m! =O) I I (k%n! =0);k++); return k; ) 【问题1】(5分)(1)请写出发生函数调用test_fl(9,6)时,函数的返回值;(2)请说明函数test_f1的功能。 【说明2】 设在某c系统中为每个字符分配1个字节,为每个指针分配4个字节,sizeof(x)计算为x分配的字节数。 函数test_12Q用于测试并输出该c系统为某些数据分配的字节数。 【c函数2】 void test_f2() { char str[] =“NewWorld”; char*p=str; char i=‘\0’; VOid*ptr=malloc(50); printf(”%d\t”,sizeof(str));printf(“%d\n”,sizeof(p)), printf(”%d\t”,sizeof(i)); printf(”%d\n”,sizeof(ptr)); } 【问题2】(4分) 请写出函数test_f2()的运行结果。 【说明3】 函数test_f3(char S[])的功能是:将给定字符串S中的所有空格字符删除后形成的串保存在字符数组tstr中(串S的内容不变),并返回结果串的首地址。 【C函数3】 char*test_f3(const char s[])( char tstr[50]=(‘\0’); unslgned int i,k=0; for(i=0;i(strlen(s);i++) if(s[i]!=‘’)tstr[k++]=s[i]; return tStr ; ) 【问题3】(6分) 函数test_f3()对返回值的处理有缺陷,请指出该缺陷并说明修改方法。
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【简答题】Thinking ·Some scientists claim that we humans are the only living things that are conscious(有意识的)—we alone are aware that we are thinking. ·No one knows how consciousness works—it is one of s...
【单选题】如图电路的节点、回路和支路数分别为:
A.
2,3,3
B.
2,2,3
C.
2,3,2
D.
1,2,3
【单选题】如图所示的电路中,支路数为( )?
A.
1
B.
2
C.
3
D.
4
【单选题】Achondroplasia is a common cause of dwarfism in humans. All individuals with achondroplasia are thought to be heterozygous at the locus that controls this trait. When two individuals with achondroplas...
A.
Achondroplasia is incompletely dominant to the normal condition.
B.
Achondroplasia is codominant to the normal condition.
C.
The allele that causes achondroplasia is a dominant lethal allele.
D.
The allele that causes achondroplasia is a recessive lethal allele.
E.
The allele that causes achondroplasia is a late-onset lethal allele.
【简答题】设计院校学生学习设计心理学的主要目的
【简答题】阅读理解。 Thinking Some scientists claim that we humans are the only living things that are conscious (有意识的)-we alone are aware that we are thinking. No one knows how consciousness works-it is one of scie...
【单选题】TMS 320C 54X DSP采用改进的哈佛结构,围绕( )条16位总线建立。
A.
4
B.
8
C.
12
D.
16
【单选题】Human societies have experienced so many wars, but have you ever thought about what a war really is? War may be a natural expression of biological instincts and drives toward aggression in the human s...
A.
it threatens the existing social systems
B.
it is influenced by society
C.
it has roots in religious conflicts
D.
it is directed against institutions of law
【判断题】我们经常两三个语气词连用,连用的语气词并非直接组合,而是处在句子结构的不同层次上。
A.
正确
B.
错误
【单选题】all humans, thought about as one large group; the human race 人类
A.
people
B.
person
C.
man
D.
mankind
相关题目: