题目内容 (请给出正确答案)
[主观题]

在下面程序模板基础上实现round方法。 注:不建议调用Math.round方法,但可以调用Math类中的除round

方法之外的其他方法。 public class Hello { public static void main(String[] args) { double pi = 3.14159; System.out.println(round(pi, 0)); //输出3.0 System.out.println(round(pi, 1)); //输出3.1 System.out.println(round(pi, 2)); //输出3.14 System.out.println(round(pi, 3)); //输出3.142 System.out.println(round(pi, 4)); //输出3.1416 } //round函数实现对number保留digit位小数四舍五入后返回 //digit大于等于0 public static double round(double number, int digit) { return 0; } }

暂无答案
如搜索结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能会需要:
您的账号:
发送账号密码至手机
发送
更多“在下面程序模板基础上实现round方法。 注:不建议调用Ma…”相关的问题

第1题

阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。

[说明]

下面程序实现十进制向其它进制的转换。

[C++程序]

include"ioStream.h"

include"math.h"

include

typedef struct node {

int data;

node*next;

}Node;

Class Transform.

{

DUDlic:

void Trans(int d,int i); //d为数字;i为进制

void print();

private:

Node*top;

};

void Transform.:Trans(int d,int i)

{

int m,n=0;

Node*P;

while(d>0)

{

(1);

d=d/i;

p=new Node;

if(!n){

p->data=m;

(2);

(3);

n++;

}

else{

p->data=m;

(4);

(5);

}

}

}

void Transform.:print()

{

Node*P;

while(top!=NULL)

{

p=top;

if(p->data>9)

cout<<data+55;

else

cout<<data;

top=p->next;

delete p;

}

}

点击查看答案

第2题

完善程序,判断数据m是否为质数。 import math m=eval()
点击查看答案

第3题

以下程序的输出结果为()。import math s=0 for i in range(1,10+1): m=int( math.sqrt(i) ) if m%2==0: continue s=s+i print(s)

点击查看答案

第4题

下面程序的功能是按如下格式输出100以内整数的平方根...

下面程序的功能是按如下格式输出100以内整数的平方根表。在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #include <stdio.h> #include <math.h> int main() { int m, n; for (m=0; m<10; m++) { printf("%7d", m); 输出表头 } _____________; for (n="0;" n++) 乘数n从1变化到9 printf("%d", n); 输出每行的开头数字 (m="0;" 被乘数m从1变化到9 printf("%7.3f", ___________); 输出第m行n列中的值 printf("\n"); 输出换行符,准备输出下一行 return 0;> A、第11行: printf("\n") 第18行: sqrt(n*10+m)

B、第11行: printf("\t") 第18行: sqrt(m*10+n)

C、第11行: printf("\f") 第18行: sqrt(10n+m)

D、第11行: printf("\0") 第18行: sqrt(10m+n)

点击查看答案

第5题

下面程序的功能是按如下格式输出100以内整数的平方根...

下面程序的功能是按如下格式输出100以内整数的平方根表。在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #include <stdio.h> #include <math.h> int main() { int m, n; for (m=0; m<10; m++) { printf("%7d", m); 输出表头 } _____________; for (n="0;" n++) 乘数n从1变化到9 printf("%d", n); 输出每行的开头数字 (m="0;" 被乘数m从1变化到9 printf("%7.3f", ___________); 输出第m行n列中的值 printf("\n"); 输出换行符,准备输出下一行 return 0;> A、第11行: printf("\f") 第18行: sqrt(10n+m)

B、第11行: printf("\t") 第18行: sqrt(m*10+n)

C、第11行: printf("\n") 第18行: sqrt(n*10+m)

D、第11行: printf("\0") 第18行: sqrt(10m+n)

点击查看答案

第6题

下面程序的功能是按如下格式输出100以内整数的平方根...

下面程序的功能是按如下格式输出100以内整数的平方根表。在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #include <stdio.h> #include <math.h> int main() { int m, n; for (m=0; m<10; m++) { printf("%7d", m); 输出表头 } _____________; for (n="0;" n++) 乘数n从1变化到9 printf("%d", n); 输出每行的开头数字 (m="0;" 被乘数m从1变化到9 printf("%7.3f", ___________); 输出第m行n列中的值 printf("\n"); 输出换行符,准备输出下一行 return 0;> A、第11行: sqrt(n*10+m) 第18行: printf("\n")

B、第11行: sqrt(m*10+n) 第18行: printf("\t")

C、第11行: sqrt(10n+m) 第18行: printf("\f")

D、第11行: sqrt(10m+n) 第18行: printf("\0")

点击查看答案

第7题

在字母M,A,T,H,I,S,F,U,N的排列中,存在多少不含样式MATH,IS,FUN的排列?

点击查看答案

第8题

听力原文:W: I heard you got a full mark in your math exam. Congratulations!

M: Thanks! I'm sure you also did a good job.

Q: What is the probable relationship between the speakers?

(2)

A.A math teacher and his colleague.

B.A teacher and his student.

C.A student and his classmate.

D.A librarian and a student.

点击查看答案

第9题

math库中返回x绝对值的函数是:

A、math.fabs()

B、math.fmod()

C、math.gcd()

D、math.ceil()

E、math.floor()

F、math.fsum()

点击查看答案

第10题

听力原文:M: I want to register for this math course.

W: I'm sorry registration has closed.

M: Closed? The clerk told me I could come back and register any time during the first week of classes.

W: Well, that's not possible. The computer's official student account has already been sent to the state. Who told you that anyway?

M: Some woman here three weeks ago. She said I just had to pay a late fee.

W: She must have been a temporary worker. They don't have much training. Why didn't you register then?

M: She said I couldn't until I had my birth certificate. Here it is.

W: Your birth certificate?

M: Well, I'm a new part-time student. So she asked for identification.

W: Huh. That's no reason to demand a birth certificate. We only need a phone bill with your name and address on. It would've been fine.

M: Really?

W: Yes. I'm afraid she gave you the wrong information. Still you'll have to wait and take your math's class next semester.

M: But that's not fair.

W: Well, I sympathize with your problem, but frankly, I don't think there is anything anyone can do for you. You were strapped in the system. If you want, you can talk to the director. She will help you if she can.

M: Great!

W: Don't get your hopes up!

What problem does the man have?

A.He doesn't want to pay the late fee.

B.He was given incorrect information.

C.He can't afford to pay his tuition.

D.He didn't pass his math class last semester.

点击查看答案
热门考试 全部 >
相关试卷 全部 >
账号:
你好,尊敬的上学吧用户
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,
如果您知道正确答案,欢迎您来纠错

警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

微信搜一搜
上学吧
点击打开微信
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
微信搜一搜
上学吧
点击打开微信