主观

在下面程序横线处填上适当字句,以使该程序执行结果为:  50 4 34 21 10  6.1 7.1 8.1 9.1 10.1 11.1

#include ﹤iostream﹥

using namespace std;

template ﹤class T﹥

void f( _____①_____ )

{ _____②_____

for(int i=0; i﹤n/2; i++)

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

}

void main( )

{ int a[5]={10,21,34,4,50};

double d[6]={11.1,10.1,9.1,8.1,7.1,6.1};

f(a,5); f(d,6);

for(int i=0; i﹤5; i++)

cout ﹤﹤ a[i]﹤﹤" ";

cout ﹤﹤ endl;

for(int i=0; i﹤6; i++)

cout﹤﹤d[i]﹤﹤" ";

cout﹤﹤ endl;

}

参考答案
您可能感兴趣的试题
¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服