设函数模板定义为 template[class T] T f(T x,T y) { return x+y; } 对该函数模板使用不正确的是( )
A: f(4,8);
B: f(4.9,8.5);
C: f(12.8f,45.9f);
D: f("123","456");
A: f(4,8);
B: f(4.9,8.5);
C: f(12.8f,45.9f);
D: f("123","456");
举一反三
- 下列函数模板定义中错误的是 A: template<class Q> B: template<class Q> Q F(Q x){return Q+x;} Q F(Q x){return x+x;} C: template<class T> D: template<class T> T F(T x){return x * x;} bool F(T x){return x>1;}
- 下面的函数模板定义中错误的是______ 。 A: A) template<class Q > B: QF (Q x)return Q +x; C: B) template<class Q > D: QF (Q x)returnx/x; E: C) template <class T > F: T F(T x) return x*x; G: D) template <class T> H: bool F (T x) return x>1;
- [单选]对于二维稳态温度场,其温度场可表示为()。 A: t=f(x,y,z,τ) B: t=f(x,y,z ) C: t=f(x,y,τ) D: t=f(x,y)
- 已知x(t)=[1,0,3]; y(t)=[2,1]; 计算卷积f(t)=x(t)*y(t) A: f(t)=[1,2,3,6] B: f(t)=[2,1,6,3] C: f(t)=[2,0,6] D: f(t)=[3,0,9] E: f(t)=[2,4,1,2]
- 二维稳定温度场的表达式为( )。 A: T=f(x,t) B: T=f(x,y) C: T=f(x,y,z) D: T=f(x,y,t)