题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-23 03:32:34

[填空题]完善下面程序段,以使其完成以下数学函数的计算。 #include<stdio.h> #include<math.h> main( ) {float x,y,f1,fun( ); scanf("%f%f",&x,&y); f1=x*x/fun(______);/*第一空*/ printf("A=%f/n",f1); } float fun(float f) {float f2; f2=f*f+sqrt(1+_____/*第二空*/+______);/*第三空*/ return(f2); }

更多"完善下面程序段,以使其完成以下数学函数的计算。 #inc"的相关试题:

[填空题]完善下面程序段,以使其完成以下数学函数的计算。
[*]
#include<stdio.h>
#include<math.h>
main( )
float x,y,f1,fun( );
scanf("%f%f",&x,&y);
f1=x*x/fun(______);/*第一空*/
printf("A=%f/n",f1);

float fun(float f)
float f2;
f2=f*f+sqrt(1+_____/*第二空*/+______);/*第三空*/
return(f2);

[简答题]
以下是某C程序段,其功能为计算输入数字的阶乘。请仔细阅读程序并完成要求。
#include<stdio. h>
#include<stdlib. h>
int main( )
{
int i=0;/*i为计数器*/
int n;
int factorial=1;/*保存阶乘的结果*/
puts("*************************************"):
puts("*The program will compute *");
puts("*the factotial of an integer *");
puts("*************************************"):
puts("please input the number n:");
scanf("%d",&n);
if(n<0)/*判断输入的数是否大于或等于0*/
{
printf("please input an interger>=0. /n");
return 0;
}
if(n==0)/*0的阶乘是1*/
{
printf("factorial of 0 is 1./n");
return 0;
}
i=1;
while(i<=n)
{
factorial = factorial * i;
i++:
}
printf("factorial of % d is:%d. /n",n,factorial);
getch( );
return 0:
}
画出此程序主函数的控制流程图。

[简答题]以下是某C程序段,其功能为计算输入数字的阶乘。请仔细阅读程序并完成要求。
#include
#include
int main( )

int i = 0;/* i为计数器 */
int n;
int factorial = 1;/* 保存阶乘的结果 */
puts("*************************************");
puts("* The program will compute *");
puts("* the factotial of an integer *");
puts("*************************************");
puts("please input the number n:");
scanf("%d",&n);
if(n < 0)/*判断输入的数是否大于或等于0*/

printf("please input an interger >= 0./n");
return 0;

if(n==0)/* 0的阶乘是1 */

printf("factorial of 0 is 1./n");
return 0;

i = 1;
while(i <= n)

factorial = factorial * i;
i++;

printf("factorial of %d is:%d./n",n,factorial);
getch( );
return 0;

画出此程序主函数的控制流程图。
[简答题]以下是某C程序段,其功能为计算输入数字的阶乘。请仔细阅读程序并完成要求。
#include<stdio.h>
#include<stdlib.h>
int main( )

int i=0;/*i为计数器*/
int n;
int factorial=1;/*保存阶乘的结果*/
puts("*****************************************");
puts("*The program will compute*");
puts("*the factotial of an integer*");
puts("*****************************************");
puts("please input the number n:");
scanf("%d", &n);
if(n<0)/*判断输入的数是否大于或等于0*/

printf("please input an interger>=0./n");
return 0;

if(n==0)/*0的阶乘是1*/

printf("factorial of 0 is 1./n");
return 0;

i=1;
while(i<=n)

factorial= factorial * i;
i++;

printf("factorial of %d is: %d./n", n, factorial);
getch( );
return 0;

画出此程序主函数的控制流程图。
[简答题]以下是某C程序段,其功能是计算输入数据是否为水仙花数,请仔细阅读程序并完成要求。
#include
void main( )

int i,a,b,c;
scanf("%d ",&i);
a=i/100;
b=i/10%10;
c=i%10;
if(i==a*a*a+b*b*b+c*c*c)
printf("%d/n",i);

画出此程序主函数的控制流程图。
[单项选择]有下面程序段 #include "stdio.h" #include "string.h" main( ) { char a[3][20]={{"china"},{"isa"},{"bigcountry!"}}; char k[100]={0},*p=k; int i; for(i=0;i<3;i++) {p=strcat(p,a[i]);} i=strlen(p) ; printf("%d/n",i);} 则程序段的输出结果是 A)18 B)19 C)20 D)21
[单项选择]有下面程序段
#include"stdio.h"
#include"string.h"
main( )
char a[3][20]="china","isa","bigcountry!";
chark[100]=0,*p=k;
int i;
for(i=0;i<3;i++)
p=strcat(p,a[i]);
i=strlen(p);
printf("%d/n","i);
则程序段的输出结果是
A. 18
B. 19
C. 20
D. 21
[单项选择]有以下程序段:
#include "stdio.h"
#include "string.h"
main( )
char a[3][20]="china","isa","bigcountry!";
char k[100]=0,*p=k;
int i;
fori=0;i<3;i++)
P=strcat(p,a[i]);
i=strlen(p);
printf("%d/n",i)=;
则程序段的输出结果是( )。
A. 18
B. 19
C. 20
D. 21
[填空题]若有以下程序段: #include <iostream> using namespace std; int main( ) { char*p="abcdefgh",*r; long*q; q=(long*)p;q++; r=(char*)q; cout<<r<<end1; return 0; } 该程序的输出结果是 【8】
[单项选择]阅读下面程序,则程序段的功能是
#include"stdio.h"
main( )
int c[]=23,1,56,234,7,0,34,i,j,t;
for(i=1;i<7;i++)
t=c[i];j=i-1;
while(j>=0 && t>c[j])
c[j+1]=c[j];j--;
c[j+1]=t;
for(i=0;i<7;i++)
printf("%d",c[i]);
putchar(’/n’);
A. 对数组元素的升序排列
B. 对数组元素的降序排列
C. 对数组元素的倒序排列
D. 对数组元素的随机排列
[填空题]若有以下程序段:
#include <iostream>
using namespace std;
int main( )

char*p="abcdefgh",*r;
long*q;
q=(long*)p;q++;
r=(char*)q;
cout<<r<<end1;
return 0;

该程序的输出结果是 【8】

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码