题目内容
(请给出正确答案)
[单选题]
下列哪一个函数的功能是将数值转换为整数?()
A.round()
B.int()
C.str()
D.float()
答案
查看答案
A.round()
B.int()
C.str()
D.float()
第1题
A.Val函数是将字符串中的数字转换成数值
B.Abs函数是求绝对值
C.Str函数是将数值数据转换成字符串
D.Int函数是求小于参数的最大整数
第4题
har*s),s为给定的整数字符串,函数返回转换的结果。
第7题
#include<stdio.h>
main()
{char*p,s[6];
int n;
p=s;
gets(p);
n=*p-'0';
while(______!='\0')
n=n*8+*p-'0';
printf("%d\n",n);
}
第8题
下面是一个将十进制正整数转换为 2进制数的函数定义:
void tobinary(int x)
{
while (x>0) {
printf("%1d",x%2);
}
}
要实现函数的功能,则在空白处应该填写的程序语句是()。
A.x=x/2;
B.x=x/10;
C.x=x%2;
D.x=x%10;