在下面程序模板基础上实现round方法。 注:不建议调用Math.round方法,但可以调用Math类中的除round
第1题
[说明]
下面程序实现十进制向其它进制的转换。
[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;
}
}
第3题
第4题
下面程序的功能是按如下格式输出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以内整数的平方根表。在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #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以内整数的平方根表。在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 #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")
第8题
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题
A、math.fabs()
B、math.fmod()
C、math.gcd()
D、math.ceil()
E、math.floor()
F、math.fsum()
第10题
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.
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!