问题 单项选择题

下面函数的运行结果是( )。
#include <iostream>
using namespace std;
class A
public:
A()
int Min(int a,int b)return a<b a:b;
int Min(int a,int b,int c)
if(a<b)return a<c a:c;
else return b<c b:c;

~A()

void main()
A a;
cout<<a.Min(1,2,3)<<a.Min(2,0);

A.10

B.12

C.30

D.32

答案

参考答案:A

解析: 函数的重载调用。首先调用3个参数返回最小值1,再调用2个参数返回最小值0。

单项选择题 A1/A2型题
单项选择题