皮皮学,免费搜题
登录
搜题
【单选题】
已知一个数列的前三项分别为0,0,1, 以后的各项相邻的前三项之和。 给定函数fun的功能是:计算并输出该数列前n项的平方根之和sum。n的值通过形参传入。 例如,当n=10时,程序的输出结果:23.197745。 请指出的错误行,并改正。 1) #include 2) #include 3) fun(int n) 4) { double sum, s0, s1, s2, s; int k; 5) sum = 1.0; 6) if (n <= 2) sum = 0.0; 7) s0 = 0.0; s1 = 0.0; s2 = 1.0; 8) for (k = 4; k <= n; k++) 9) { s = s0 + s1 + s2; 10) sum += sqrt(s); 11) s0 = s1; s1 = s2; s2 = s; 12) } 13) return sum;} main ( ) { int n; printf("Input N="); scanf("%d", &n);printf("%f\n", fun(n) );}}
A.
出错行序号:13    应改为: return (sum);
B.
出错行序号:5    应改为: sum=1;
C.
出错行序号:3    应改为: double fun(int n)
D.
出错行序号:6    应改为: double fun(int n)
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】Wealth______those who make things happen not to those who let things happen.
A.
takes to
B.
comes to
C.
goes in for
D.
sets aside for
【简答题】冷却系的功用就是保持发动机在 ( ) 的温度范围内工作。
【简答题】Anne of Green Gables by L. M. Montgomery Marilla’s lips twitched understandingly. She had expected Mrs. Rachel to say this; she had known that the sight of Matthew jaunting off so unaccountably would...
【多选题】在盆腔断面中,寻找坐骨神经可以根据以下哪些肌肉来判断
A.
臀大肌
B.
髂腰肌
C.
闭孔内肌
D.
闭孔外肌
【多选题】在男性盆腔断面中,寻找坐骨神经可以根据以下哪些肌肉来判断
A.
臀大肌
B.
髂腰肌
C.
闭孔内肌
D.
闭孔外肌
【多选题】与消费者互动要遵循的原则是()
A.
便捷性
B.
创新
C.
体验度
D.
趣味性
【单选题】我国肾综合征出血热的主要传染源是
A.
鼠类
B.
患者
C.
病毒携带者
D.
E.
【简答题】It was a cold winter's night. It was getting late and l was tired so I went to bed. At about two in the morning my phone began to ring. It was from Mum. I started to feel frightened, because she only ...
【多选题】赵女士,55岁,因肺心病急诊入院,急诊室给予输液、吸氧,现准备用平车送入病区,护送途中下列错误的是
A.
病人应卧于小轮一侧
B.
护士应站在病人脚的一侧
C.
进门时用推车轻轻把门推开
D.
骨折病人应在平车上垫上木板
【简答题】Philips (飞利浦电器) —— 让我们做得更好。 Let’s make things ______.
相关题目: