皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
下列给定,函数fun()的功能是:用下面的公式求π的近似值,直到最后一项的绝对值小于指定的数(参数num)为止。 π/4≈1-1/3+1/5-1/7+… 例如,程序运行后,输入0.0001,则程序输出3.1414。 请改正的错误,使它能得出正确的结果。 注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。 试题程序: include <math.h> include <stdio.h> float fun(float num) { int s; float n,t, pi; t=1 ;pi=0; n=1; s=1; /**************found***************/ while (t>=num) { pi=pi+ t; n=n+2; s=-s; /**************found**************/ t=s% n; } pi=pi*4; return pi; } main () { float n1, n2; clrscr (); printf ('Enter a float number: '); scanf ('%f', &n1); n2=fun (n1); print f (' %6.4 f/n ', n2); }
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【单选题】, : 包含 的闭曲线的值为
A.
1
B.
0
C.
-1
D.
2
【单选题】对于可视对讲系统,一般在住宅小区主要出入口的控制设备叫做?
A.
对讲主机
B.
对讲分机
C.
电控锁
D.
电源箱
【简答题】Ethanol, Schmethanol Everyone seems to think that ethanol is a good way to make cars greener. However , everyone is wrong. 1 Sometimes you do things simply because you know how to do. People have know...
【单选题】From the perspective of the poor, it seems obvious that the benefits would outweigh the costs. The benefits to poor people of no longer being poor would be enormous. Their intake of protein and other ...
A.
A rich businessman humiliates his poor fellow for not working hard.
B.
A worker beats a gentleman for his staring at his beautiful wife.
C.
A poor man murders another poor one just for his money.
D.
A president of a company sends a spy to another company to steal some information.
【单选题】子曰: “道之以政,齐之以刑,民免而无耻。道之以德,齐之以礼,有耻且格。”一句中,“道”指 ,“格”指 。
A.
方法;格式
B.
道路; 形式
C.
引导;自动纠错
D.
指导;格式
【单选题】“道之以政,齐之以刑,民免而无耻;道之以德,齐之以礼,有耻且格”出自哪里?
A.
《论语》
B.
《礼记·中庸》
C.
《大学》
D.
《中庸》
【单选题】People all over the world know Wimbledon as the center of lawn tennis. In 1874 it was a country village, but it was the home of the All England Croquet Club. The Club had been there since 1864. A lot ...
A.
a country village
B.
the home of an unusual croquet club
C.
the center of lawn tennis
D.
a famous place of interest near London
【单选题】设 为一条不过原点且不包含原点的光滑闭曲线,则 的值为( ).
A.
B.
C.
0
【简答题】甲、乙两同学想了解碳酸钾溶液的酸碱性.他们做了以下研究: [猜想与假设]碳酸钾溶液的酸碱性可能有______种情况; [设计与实验]用pH试纸来检测碳酸钾溶液的酸碱性: 实  验  操  作 检测结果 甲同学 取pH试纸放在玻璃片上; 用玻璃棒蘸取碳酸钾溶液沾在pH试纸上; 将试纸显示的颜色与标准比色卡比较. pH>7 乙同学 将pH试纸直接浸入碳酸钾溶液中,把试纸显示的颜色与标准比色卡比较. P...
【单选题】“道之以政,齐之以刑,民免而无耻;道之以德,齐之以礼,有耻且格。”出 自()
A.
《论语》
B.
《大学》
C.
《孟子》
D.
《中庸》
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题