初学,跟老师打的一样但是出错了看了半天不知道是什么问题,希望解答一下谢谢

 

好像没什么问题 

#include<iostream>
#include<string>

using namespace std;
struct Student
{
	string name;
	int age;
	int score;
};

int main()
{
	struct Student stuArray[3] = 
	{
		{"张三",18,100},
		{"李四",28,99},
		{"王五",38,66}
	};
	
	stuArray[2].name="赵六";
	stuArray[2].age = 80;
	stuArray[2].score = 60;
	
	for (int i=0; i<3; i++)
	{
		cout<<"姓名:"<<stuArray[i].name<<" 年龄:"<<stuArray[i].age<<" 分数:"<<stuArray[i].score<<endl; 
	}
	system("pause");
	return 0;
}

 

 

请你把你的程序写下来