编辑代码

#include <stdio.h>
#include <string.h>

struct student{
    char name[10];
    int age;
    double soc;
};

Scanf(struct student* stu){
    printf("请输入学生姓名");
    scanf("%s",stu->name);
    printf("请输入学生年龄");
    scanf("%d",&(stu->age));
    printf("请输入学生成绩");
    scanf("%lf",&(stu->soc));
}

int main () {
    struct student stu1;
    Scanf(&stu1);
    printf("名字:%s\t年龄:%d\t成绩:%.2lf",stu1.name,stu1.age,stu1.soc);

    printf("成功");
}