填空题

在下面程序横线处填上适当内容,使得程序的输出为9876。
#include <iostream>
using namespace std;
template<class T>
void f( 【12】 )

T t;
for (int i=0;i<n/2;i++)

t=a Ii];
a [i]=a[n-1-i];
a [n-1-i]=t;


int main ( )

int x[]=6,7,8,9;
f(x,4);
for (int i=0;i<4;i++)
cout<<x[i];
cout<<end1;
return 0;

【参考答案】

Ta[],int n
<上一题 目录 下一题>
热门 试题

填空题
以下程序中的select()函数功能是:在N行M列的二维数组中选出一个最大值作为函数值返回,并通过形参传回此最大值的行下标。请填空完成此程序。 #include<iostream> #define N 3 #define M 3 using namespace std; int select(int a[N][M],int *n) int i,j,row=0,colum=0; for(i=0;i<N;i++) for(i=0;j<M;j++) if(a[i][j]>a[row][colum]) row=i; colum=j; *n= 【7】 ; return 【8】 ; int main() int a[N][M]=9,11,23,6,1,15,9,17,20; int max,n; max=select(a,&n); cout<< max= <<max<< line= <<n<<end1; return 0;
填空题
以下程序的执行结果为 【9】 。 #include<iostream> using namespace std; void overload(int num) cout<<num<<end1; void overload(char ch) char c=ch+1; cout<<c<<end1; int main() overload(’X’); return 0;
相关试题
  • 以下程序设计功能是:将结构体变量time 中...
  • 有以下程序: #include <iostream> u...
  • 在成员函数声明的前面加上关键词 【11】...
  • 带有虚基类的多层次派生类构造函数的成员初...
  • 如下程序执行后的输出结果是 【14】 。...