写出下列程序的执行结果是:__________________。#includeusing namespace std;void sort( double x,double y );void sort( double x,double y,double z );void main(){ sort( 0.5, 30.8, 5.9 );}void sort( double x,double y,double z ){ double t; if( y
查看答案
写出下列程序的执行结果是:__________________。#includeusing namespace std;void f ( int&n );void main(){ int a = 1 ; f( a );}void f ( int& n ){ cout<
在下面横线处填上求两个浮点数之差的cha函数的原型声明、调用方法。#include using namespace std;void main( ){float a,b;float cha(float,float);a=12.5;b=6.5;float c=________________//调用函数chacout<
在下划线处填上适当字句,完成求最大值函数模板的定义。#include using namespace std;template T Max(T x, T y){ return(x>y ? x : y);}(1)__________T Max(T x, T y, T z){ T t=Max(x,y); return(Max(t,z)); }void main(){ int x; double y; x = Max(5, 6); y = Max(12.3, 3.4, 7.8); cout<<"x=" << x<<"y="<
下面程序三次调用同一函数sum,在下划线处填上适当内容,使输出结果为:S=2S=5S=9#include using namespace std;void sum(int i){static int s;(1)____ ;cout << "s=" << s << end;}void main(void){int i;for (i = 0; (2)____ )sum(i);}