编辑代码

#include <iostream>
using namespace std;
#include <string>
struct student{
    string name;
    int age;
    int score;
};
void printStudent(struct student *p){
    p->age=100;
    cout<<"学生的姓名:"<<p->name<<"年龄:"<<p->age<<"分数:"<<p->score<<endl;
}
int main(){
      struct studnet s;
      s.name="张三";
      s.age=20;
      s.score=85;
      student *p=&s;
      printStudent(&s);
      cout<<"学生的姓名:"<<s.name<<"年龄:"<<s.age<<"分数:"<<s.score<<endl;
}