题目内容

写出下列程序的执行结果是:__________________。#include using namespace std;template void fun( T &x, T &y ){ T temp; temp = x; x = y; y = temp;}void main(){ int i , j; i = 10; j = 20; fun( i, j ); cout << "i=" << i << "," << "j=" << j << ","; double a , b; a = 1.1; b = 2.2; fun( a, b ); cout << "a=" << a <<","<< "b=" << b << endl;}

查看答案
更多问题

在下划线处填上缺少的部分。源程序如下:#include using namespace std;template T fun(T x) { _________________ y; y=x*x-T(5); return y; } void main() { float a=2; cout<

如下函数的作用是以双倍行距输出文件:void double_space(ifstream& f, ofstream& t){ char c; while(______){ ______; if(c=='\n') t.put(c); }}下划线处应填入的内容是______。

下列程序运行结果为______。#includeusing namespace std;class S{public: ~S( ) { cout<<"S"<< "\t"; }};char fun0(){ S s1; throw( 'T'); return '0';}int main(){ try { cout<

写出程序运行结果。#include using namespace std;int a[10]= {1,2, 3, 4, 5, 6, 7, 8, 9, 10};int fun( int i);int main(){ int i ,s=0; for(i=0; i<=10; i++) { try { s=s+fun(i); } catch(int) { cout<< "数组下标越界!"<

答案查题题库