#include<iostream>
#include<string>
using namespace std;
struct student{
int number;
int score;
string name;
};
int main()
{
student s[4]={{1,100,"张三"},
{2,98,"李四"},
{3,95,"王五"},
{4,93,"罗刘" },
};
for(int i=0;i<4;i++)
{
cout<<"座号: "<<s[i].number<<endl;
cout<<"姓名: "<<s[i].name<<"\t"<<"分数: "<<s[i].score<<endl;
}
return 0;
}
简单结构struct
最新推荐文章于 2024-04-07 13:28:56 发布