设有定义: float x=123.4567; ,则执行以下语句后的输出结果是 【 6 】 。
printf("%f\n",(int)(x*100+0.5)/100.0);
查看答案
若变量 a , b 已定义为 int 类型并赋值 21 和 55 ,要求用 printf 函数以 a=21 , b=55 的形式输出,请写出完整的的输出语句 【 6 】 。
● 根据《软件工程产品质量》 (GB/T 16260.1-2006)定义的质量模型,(13)不属于易用性的质量特性。
(13)A. 易分析性 B. 易理解性 C. 易学性 D. 易操作性
● 数据测量时,对同一对象进行多次测量可能得到多个数值。精确度是指多次所测得的数值彼此接近的程度;准确度是指所测得的数值与真值符合的程度。实际测量时,不可能出现的情况是 (64) 。
(64)
A. 精确度与准确度都很好
B. 精确度很好但准确度不好
C. 精确度与准确度都不好
D. 准确度很好但精确度不好
●试题七
阅读以下说明和C++代码,将解答写入答题纸的对应栏内。
【说明】
请编写一个函数int SeqSearch(int list[],int start,int n,int key),该函数从start开始,在大小为n的数组list中查找key值,返回最先找到的key值的位置,如果没有找到则返回-1。请修改程序中画线部分的错误并将不同情况下的输出结果补充完整。
【程序】
文件search.cpp的内容如下:
#include <iostream.h>
int SeqSearch(int list[],int start,int n,int key)
{
for(int i=start;i<=n;i++)// (1)
{
if(list[i]=key) // (2)
{
return i;
}
}
return -1;
}
void main()
{
int A[10];
int key,count=0,pos;
cout<<" Enter a list of 10 integers: ";
for(pos=0;pos<10;pos++)
{
cin>>A; // (3)
}
cout<<"Enter a key: ";
cin>>key;
pos=0;
while((pos=SeqSearch(A,pos,10,key))!=-1)
{
count++;
pos++;
}
cout<<key<<" occurs "<<count<<(count!=1?" times":" time")<<" in the list."<<endl;
}
第一种情况:输入2 3 12 6 8 45 8 33 7 输入key:8
输出: (4)
第二种情况:输入2 3 12 6 8 45 8 33 7 输入key:9
输出: (5)