填空题 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

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考