第30948题 单选题
以下C++代码中,对应位置的输出语句能正确打印结构体成员的是?
#include <iostream>
#include <string>
using namespace std;

struct Student {
    string name;
    int age;
};

int main() {
    Student s1 = {"张三", 18};
    Student *p = &s1;
    // 下列四个输出语句中,哪一个可以正确输出s1的姓名和年龄?
    return 0;
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析