在下面程序下划线处填上适当内容,使程序执行结果为:200________100#include using namespace std;Template(1____)T f(T x, T y){if (sizeof(T) == (2____))return x + y;elsereturn x*y;}void main() {cout << f(10, 20) << "--" << (45.5, 54.5) << endl;}
查看答案
在下划线处填上适当字句,完成求最大值函数模板的定义。#include using namespace std;template T Max(T x, T y){return(x>y ? x : y);}(1____));}void main(){int x;double y;x = Max(5, 6);y = Max(12.3, 3.4, 7.8);cout << "x=" << x<"y="
请写出程序的运行结果。includeusing namespace std;int f____ {int c;if ____ c = l;elseif ____ c = 0;elsec = -1;return ____;}void main____ {int i = 2, j = 3;int p = f____;cout << p << endl;}
请写出程序的输出结果。#include < iostream> using namespace std;void f2____{int z = x; x = y; y = z;}void main____{int x = 10, y = 26;cout << "x, y=" << x << "," << y << endl;f2____;cout << "x, y=" << x << "," << y << endl; x++; y--;f2____;cout << "x, y=" << x << "," << y << endl;}
阅读下列程序,并写出输出结果。#includeusing namespace std;int min____{return a