第30482题 单选题
以下C++代码执行后的输出结果是?

已知当前编译环境为64位GCC,int占4字节,float占4字节,typeid返回的类型名中int对应"i",float对应"f",char对应"c"。代码如下:

#include <iostream>
#include <typeinfo>
using namespace std;
int main() {
    int a = 10;
    char b = 'a'; // 字符'a'的ASCII值为97
    float c = 1.5f;
    cout << sizeof(a + b) << " " << typeid(b + c).name() << endl;
    return 0;
}
A

4 f

B

1 c

C

4 i

D

8 d

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析