题目内容

若变量 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)

●试题四
阅读以下说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
将一正整数序列{K1,K2,…,K9}重新排列成一个新的序列,新序列中,比K1小的数都在K1的前面(左面),比K1大的数都在K1的后面(右面),最后调用writeDat()函数的新序列输出到文件out.dat中。
在程序中已给出了10个序列,每个序列有9个正整数,并存入数组a[10][9]中,分别求出这10个新序列。
例:序列 {6,8,9,1,2,5,4,7,3}
经重排后成为{3,4,5,2,1,6,8,9,7}
【函数】
#include<stdio.h>
#include<conio.h>
void jsValue(int a[10][9])
{int i,j,k,n,temp;
int b[9];
for(i=0;i<10;i++)
{temp=a[i][0];
k=8;n=0;
for(j=8;j=0;j--)
{if(temp<a[i][j]) (1) =a[i][j];
if(temp>a[i][j]) (2) =a[i][j];
if(temp=a[i][j]) (3) =temp;
}
for(j=0;j<9;j++)a[i][j]=b[j];
}
}
void main()
{
int a[10][9]={{6,8,9,1,2,5,4,7,3},{3,5,8,9,1,2,6,4,7},
{8,2,1,9,3,5,4,6,7},{3,5,1,2,9,8,6,7,4},
{4,7,8,9,1,2,5,3,6},{4,7,3,5,1,2,6,8,9},
{9,1,3,5,8,6,2,4,7},{2,6,1,9,8,3,5,7,4},
{5,3,7,9,1,8,2,6,4},{7,1,3,2,5,8,9,4,6}
};
int i,j;
(4) ;
for(i=0;i<10;i++){
for(j=0;j<9;j++){
printf("%d",a[i][j]);
if((5) )printf(",");
}
printf("\n");
}
getch();
}

答案查题题库