填空题
C++
题号 #4126108
在下面程序横线处填上适当内容,以使该程序执行结果为:
The pair is(21,55)
The pair is(21.7,85.4)
#include<iostream>
using namepace std;
template<class T>
class pair{
public:
T x,y;
void show(){
cout<<”The pair is (“<<x<<’,’<<y<<’)’<<endl;
}
};
int main(){
;
c1.show();
¬¬¬;
c2.show();
return 0;
}
参考答案
暂无
答案解析
pair<int>c1; c1.x=21; c1.y=25
pair<double>c2; c2.x=21.7; c2.y=85.4
pair<double>c2; c2.x=21.7; c2.y=85.4