题解 | #结构体简单使用#

结构体简单使用

http://www.nowcoder.com/practice/87c31efeb07b496cb88b137b54b98330

#include <iostream>
#include <string>
using namespace std;

struct student {
    // write your code here......
    string name;
    int age;
    double height;
};

int main() {

    // write your code here......
    student st;
    cin>>st.name>>st.age>>st.height;
    cout<<st.name<<" "<<st.age<<" "<<st.height<<endl;

    return 0;
}
全部评论
为什么name前面一定要写成string,变成char就不能正常运行了呀
点赞 回复 分享
发布于 2022-12-03 17:18 甘肃

相关推荐

在开会的单身狗很有一套:学院本被想着这么快有面试,而且简历废话太多了 那些在校经历什么荣誉什么的企业不关心
点赞 评论 收藏
分享
评论
8
2
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务