不属于防火或安全使用的玻璃是()。A.镀膜玻璃B.夹层玻璃C.夹丝玻璃D.钢化玻璃
不属于防火或安全使用的玻璃是()。
A.镀膜玻璃
B.夹层玻璃
C.夹丝玻璃
D.钢化玻璃
不属于防火或安全使用的玻璃是()。
A.镀膜玻璃
B.夹层玻璃
C.夹丝玻璃
D.钢化玻璃
第1题
请编写一个函数void fun(int a [],int n),其中a为数组,n为数组a的长度。函数fun()的功能是冒泡排序法将数组a元素按从小到大的顺序排列,实现数组a的升序排列。
注意:部分源程序已存在文件PROC12.cpp中。
请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句。
文件PROC12.cpp的内容如下:
//PROC12. cpp
include <iostream>
using namespace std;
define MAX 100
void fun(int a[],int n);
int main ()
{
int a[MAX],n,i;
cout<<"Please enter the array size n:\n";
do {
cin>>n;
if (n>100)
cout<<"array size flowover! ReEnter a number(0-100)\n";
}while (n>100);
cout<<"Enter the array data:\n";
for (i=0; i<n; i++)
cin>>a [ii;
fun(a[],n);
for (i=0; i<n; i++)
cout<<a [i] <<" ";
cout<<end1;
return 0;
}
void fun(int a[ ],int n)
{
// * * * * * * * *
}
第2题
编写函数fun(),它的功能是求n以内(不包括n)同时能被5与11整除的所有自然数之和的平方根s,并作为函数值返回。
例如:n为1000时,函数值应为s=96.979379。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include <conio.h>
include <math.h>
include
double fun(int n)
{
}
main()
{
clrscr();
printf("s=%f\n",fun(1000));
}
第3题
编写函数fun(),它的功能是求n以内(不包括n)同时能被3与7整除的所有自然数之和的平方根s,并做为函数值返回。例如:n为1000时,函数值应为s=153.909064。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include <conio.h>
include <math.h>
include <stdio.h>
double fun(int n)
{
}
main()
{
clrscr();
printf("s=%f\n", fun(1000));
}
第4题
请编写一个函数fun(),它的功能是求出一个正整数的所有因子。例如,若输入72, 则程序应该输出:72=2*2*2*3*3。
注意:部分源程序已存在文件PROC14。CPP中。
请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句。
文件PROC14.cpp的内容如下:
//PROC14. cpp
include <iostream>
using namespace std;
void fun(int number);
int main ()
{
int n;
cout<<"Please enter a number \n";
cin>>n;
cout<<n<<"=";
fun (n);
return 0;
}
void fun(int number)
{
//* * * * * * *
}
第5题
函数double fun(double x, int n)的功能是计算,则调用fun函数计算的函数调用语句为____________。
第6题
请编写一个函数void fun(int p[],int n,int c),其中数组p的元素按由小到大的顺序排列,其元素个数为n。函数fun()的功能是将c插入到数组p中,且保持数组的升序排列。
注意:部分源程序已存在文件PROC9.cpp中。
请勿修改主函数和其他函数中的任何内容,仅在函数fun()的花括号中填写若干语句;
文件PROC9.cpp的内容如下:
//PROC9.cpp
include <iostream>
include <string>
using namespace std;
define M 30
void fun(int p[ ],int n,int c);
int main ()
{
int pp[M],n,i;
int fg, c;
cout<<"Please input n:\n";
cin>>n;
cout<<"Please input the n data:\n";
for (i=0; i<n; i++)
cin>>pp [i];
cout<<"Please input c:\n";
cin>>c;
fun (pp, n, c);
for (i=0; i<n; i++)
cout<<pp [i] << " " ;
cout<<end1;
return 0;
}
void fun(int p[ ],int n, int c)
{
//* * * * * * * * *
}
第8题
函数double fun(double x, int n)的功能是计算,则调用fun函数计算的函数调用语句为____________。
第9题
请编写一个函数fun(),它的功能是:求出一个4×M整型二维数组中最小元素的值,并将此值返回调用函数。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仪在函数fun的花括号中填入所编写的若干语句。
试题程序:
define M 4
include<stdio.h>
fun (int a[])[M])
{
}
main()
{
int arr[4][M]={11,3,9,35,42,-4,24,32,6,48,-32,7,23,34,12,-7);
printf(“min=%d\n”,fun(arr));
}
第10题
编写函数int fun(int lim, int aa[MAX]),该函数的功能是求出小于或等于lim的所有素数并放在aa数组中,该函数返回所求出的素数的个数。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include<conio.h>
include<stdio.h>
define MAX 100
int fun(int lim, int se[MAX])
{
}
main()
{
int limit,i,sum;
int aa[MAX];
clrscr();
printf("输入一个整数");
scanf("%d",&limit);
sum=fun(limit,aa);
for(i=0;i<sum;i++)
{
if(i%10==0&&i!=0) /*每行输出10个数*/
printf("\n");
printf("%5d ",aa[i]);
}
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!