(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);}

(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);}


相关考题:

有以下程序 include define N 5 define M N+1 有以下程序 #include <stdio.h> #define N 5 #define M N+1 #define f(x) (x*M) main() { int i1,i2; i1=f(2) i2=f(1+1); printf("%d %d\n",i1,i2); } 程序的运行结果是______。A.12 12B.11 7C.11 11D.12 7

在下面的程序的横线处填上适当的语句,使该程序的输出为12。 include using namespace 在下面的程序的横线处填上适当的语句,使该程序的输出为12。include<iostream.h>using namespace std;class Base{public:int a,b;Base(int i){a=i;}};class Derived:public Base{int a;public:Derived(int x):Base(x),b(x+1){};void show(){______;//输出基类数据成员a的值cout<<b<<endl;}};int main(){Derived d(1);d.show();return 0;

( 12 ) 【 12 】 SQL 语句是指在程序编译时尚未确定 , 其中有些部分需要在程序的执行过程中临时生成的 SQ L语句。

函数fun的功能是:根据以下公式求p的值,结果由函数值返回。m与n为两个正数且要求mn。例如:m=12,n=8时,运行结果应该是495.000000。请在题目的空白处填写适当的程序语句,将该程序补充完整。#include#includefloat fun (int m, int n){ int i;double p=1.0;for(i=1;i=m;i++)( );for(i=1;i=n;i++)( );for(i=1;i=m-n;i++)p=p/i;return p;}main (){ clrscr();printf ("p=%f\n",fun (12,8));}

在下列的程序的横线处填上适当的语句,使该程序的输出为12。 includeusing namespace st 在下列的程序的横线处填上适当的语句,使该程序的输出为12。include<iostream>using namespace std;class TestClass{public:int a,b;TestClass(int i,int j){a=i;b=j;}};class TestClass1:public TestClass{int a;public:TestClass1(int x):TestClass(x,x+1){}void show(){______;//输出基类数据成员a的值?cout<<b<<endl;}};int main(){TestClass1 d(1);d.show();return 0;}

有以下程序:程序的运行结果是( )。A.12 12B.11 7C.11 11D.12 7

有以下程序,请在 处填写正确语句。使程序可正常编译运行。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 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;}};

有以下程序includeincludevoid main( ){char*p="abcde\0fghjik\0"; cou 有以下程序 #include<string.h> #include<iostream.h> void main( ) { char*p="abcde\0fghjik\0"; cout<<strlen(p);} 程序运行后的输出结果是A.12B.15C.6D.5

若运行时给变量x输入12,则以下程序的运行结果是 include void main( ) { int 若运行时给变量x输入12,则以下程序的运行结果是 #include<iostream.h> void main( ) { int x,y; cin > > x; y=x > 12? x+lO:x-12; cout < < y; cout < < end1; }A.0B.22C.12D.10

有以下程序: include main( ) {char s[ ] ="159" , * p;p=s;printf( "% c", * p + + 有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。A.15B.16C.12D.59

有以下程序includemain(){int a=5,b=lt; t=(a 有以下程序 #include<stdio.h> main() { int a=5,b=lt; t=(a<<2)|b;printf("%d\n",t); } 程序运行后的输出结果是______。A.21B.11C.6D.1

有以下程序includemain(){char *p=“abcde、Ofghjik\0”;printf(“%d\n”,strlen(p));} 程 有以下程序 #include<string.h> main() { char *p=“abcde、Ofghjik\0”; printf(“%d\n”,strlen(p)); } 程序运行后的输出结果A.12B.15C.6D.5

下面程序运行后,输出的结果是如下矩阵:4 7 105 8 116 9 12请在程序[ ]处填入正确的内容。

有以下程序: include main( ){ int m =12,n=34;printf( "% d% d" ,m++ , ++n);printf( 有以下程序: #include <stdio.h>main( ){ int m =12,n=34; printf( "% d% d" ,m++ , ++n); printf("% d% d \n" ,n ++ , ++m); }程序运行后的输出结果是( )。A.12353514B.12353513C.12343514D.12343513

有以下程序:当执行程序时,按下列方式输入数据(从第l列开始,&lt;CR&gt;代表回车,注意:回车也是一个字符]12&lt;CR&gt;34&lt;CR&gt;则输出结果是( )。A.12B.123C.1234D.12343

若运行时给变量x赋值12,则以下程序的运行结果是()。includemain(){int x,y; scanf("%d" 若运行时给变量x赋值12,则以下程序的运行结果是( )。 #include<stdio.h> main() { int x,y; scanf("%d",x); y=x>12? x+10:x-12; printf("%d\n",y); }A.0B.22C.12D.10

请在如下程序中的空格处填写正确的语句: 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;}};

在下列的程序的横线处填上适当的语句,使该程序的输出为12。include using namespace 在下列的程序的横线处填上适当的语句,使该程序的输出为12。include<iostream.h>using namespace std;class Base{public:int a,b;Base(int i){a=i;}};class Derived:public Base{int a;public:Derived(int x):Base(x),b(x+1){};void show(){

在下面的程序的横线处填上适当的语句,使该程序的输出结果为12。include using namespac 在下面的程序的横线处填上适当的语句,使该程序的输出结果为12。include<iostream>using namespace std;class TestClass{public:int a,b;TestClass(int i,int j){a=i;b=j;}};class TestCla

请在下列程序的横线处填写正确的语句。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(){______∥ 调用基类的函数

以下程序的定义语句中,x[1]的初值是 [9] ,程序运行后输出的内容是 [10] 。include main( 以下程序的定义语句中,x[1]的初值是 [9] ,程序运行后输出的内容是 [10] 。include <stdio.h>main(){ int x[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},*p[4],i;for(i=0;i<4;i++){ p[i]=x[2*i+1];printf("%d",p[i][0]);}printf("\n");}

单选题有以下程序:#include main(){ int k=10; printf(%4d,%o,%x,k,k,k);}程序的运行结果是(  )。(u代表一个空格)A10,12,aBuu10,012,aC010,12,aDuu10,12,a

单选题有以下程序:#include #include main(){ char str[12]={'s', 't', 'r', 'I', 'n', 'g'}; printf(%d,strlen(str));}程序运行后的输出结果是(  )。A6B7C11D12

单选题有以下程序:#include#includemain(){ chars[]=Beijing; printf(%d,strlen(strcpy(s,China)));}程序运行后的输出结果是(  )。A5B7C12D14

单选题有以下程序:#include main(){ int x=011; printf(%d,++x);}程序运行后的输出结果是(  )。A12B11C10D9

单选题有以下程序#include #include main(){ int a = 3; printf(%d,(a+=a-=a*a));}程序运行后的输出结果是(  )。A-12B9C0D3