填空题
下列程序的输出结果是______。 #include<iostream> using namespace std; template<typename T> T fun(T a,T b){return(a<=b)a:b;} int main() { cout<<fun(3,6)<<‘,’<<fun(3.14F,6.28F)<<end1; return 0; }
【参考答案】
3,3.14。
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
下列程序用于将源文件中的字母进行大小写转换,请填写while的请句。#include<iostream.h>#include<fstream.h>#include<iomanip.h>void main(){char ch;fstream file1,file2;char fnl[10],fn2[10];cout<<“输入源文件名:”;cin>>fn1;cout<<“输入目标文件名:”;cin>>fn2;{ilel.open(fn1,ios::in);while( ){证(ch)=,a,&&ch<=’z,)ch=ch- a +’A’;file2.put(ch);}file1.close();file2.close();}
点击查看答案&解析
填空题
请按下面注释的提示,将类B的构造函数定义补充完整。classA{int a;public:A(int aa=0) {a=aa;)};Class B:public A{int b;A c;public: 用aa初始化基数A,用aa+1初始化类对象成员cB(int aa): (b=aa+2)};
点击查看答案&解析
相关试题
有如下程序:#include<iostream>using ...