网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有以下程序,请在 处填写正确语句。使程序可正常编译运行。

include

mairl();

{double x,y,(*p)():

scanf(“%If%If”,&x,&y);

P=avg;

printf(“%f\n”,(*p)(x,y));

}

double avg(double a,doublc b)

{return((a十b/2):


参考答案

更多 “ 有以下程序,请在 处填写正确语句。使程序可正常编译运行。include;mairl();{double x,y,(*p)():scanf(“%If%If”,x,y);P=avg;printf(“%f\n”,(*p)(x,y));}double avg(double a,doublc b){return((a十b/2): ” 相关考题
考题 有以下程序ineludemain(){ float x,y;scan{("%f",if(x 有以下程序inelude<stdio.h>main(){ float x,y;scan{("%f",else if(x<10.0)y=1.0/x;else y=10.0;printf("%f\n",y);}若运行时从键盘上输入2.0<CR>(<CR>表示回车),则上面程序的输出结果是()A.0B.0.25C.0.5D.1

考题 请在下列程序中的横线处填写正确的语句。include using namespace std; class Base{ pu 请在下列程序中的横线处填写正确的语句。include<iostream>using namespace std;class Base{public:void fun(){cout<<“Basefun”<<endl;});class Derivde:public Base{public:void fun(){//调用基类的函数fun()cout<<“Derived fun”<<endl;}};

考题 有以下程序:include main() {int a[] = {2,4,6,8,10} ,y =0,x, * p;p =a[1];for( 有以下程序: #include <stdio.h> main() { int a[] = {2,4,6,8,10} ,y =0,x, * p; p =a[1]; for(x=1;x<3;x++)y+ =p[x]; printf( "% d \n" , y); }程序运行后的输出结果是( )。A.10B.11C.14D.15

考题 有如下程序:#includeiostream#includecmathusing std::cout;class Point{public:friend double distance(const Point p); //P距原点的距离Point(int xx=0,int yy=0):x(xx),Y(YY){}//①private:int x,y;};double distance(const Point p){ //②return sqrt(P.x*P.x+P.y*P.y);}int main(){Point p1(3,4);coutdistance(p1);return 0; //③}下列叙述中正确的是A.程序编译正确B.程序编译时语句①出错C.程序编译时语句②出错D.程序编译时语句③出错

考题 下列程序不能通过编译,应该在划线部分填写的语句是【 】。includeinclude 下列程序不能通过编译,应该在划线部分填写的语句是【 】。include<iostream. h>include<stdlib. hdouble Fune(int a, int b, char ch){double x;switch(ch){case '+':x=double(a) +b;break;case '--':x= double(a) --b;break;case '/':x=double(a) * b;break;case '/':if(B) x=double(a) /b;elseexit(1)breakdefault:exit(1);}______}void main(){cout<<Func(32 , 6 ,'--')<< ",";cout<<Func(32, 6 ,'*') <<",";cout<<Func(32, 6 ,'/') <<end1;}

考题 请在如下程序中的空格处填写正确的语句: include using namespace std; class Base { 请在如下程序中的空格处填写正确的语句:include <iostream>using namespace std;class Base {public:void fun() {cout<<"Base fun"<<endl; }};class Derived: public Base {public:void fun() {【 】; //调用基类的函数fun()cout<<"Derived fun "<<endl;}};

考题 请在下列程序的横线处填写正确的语句。include using namespace std; class Base{ publ 请在下列程序的横线处填写正确的语句。include<iostream>using namespace std;class Base{public:void fun(){cout<<"Base fun"<<endl;}};class Derivde:public Base{public:void fun(){______∥ 调用基类的函数

考题 下列程序不能通过编译,应该在划线部分填写的语句是______。 include include 下列程序不能通过编译,应该在划线部分填写的语句是______。include<iostream.h>include<stdlib.h>double Func(int a,int b,char ch){double x;switch(ch){case'+':x=double(a)+b;break;case '-':x=double(a)-b;break;case '*':x=double(a)*b;break;case'/':if(B)x=double(a)/b;elseexit(1);break;default:exit(1);}______}void main( ){cout<<Func(32,6,'-')<<",";cout<<Func(32,6, '*')<<",";cout<<Func(32,6,'/')<<endl;}

考题 (12)有以下程序,请在 【12】 处填写正确语句,使程序可正常编译运行。#include stdio.h【12】 ;main(){ double x,y,(*p)();scanf("%lf%lf",x,y);p=avg;printf("%f\n",(*p)(x,y));}double avg(double a,double b){ return((a+b)/2);}