student 结构体标签
num,scores 结构体中变量的定义
stu1,stu2,stu3 结构变量
定义在结构的末尾,最后一个分号之前可以指定一个或多个结构变量。
struct{ //无结构体标签
int a1;
int b1;
}s1;
struct node1{
int a2;
int b2;
};//无声明变量
typedef struct node{
int a3;
int b3;
struct node1 abb;
struct node *next;
}s2,*sw;
//现在可以用s2作为类型声明新的结构体变量
int main(){
struct node1 m;
m.a2;
// 访问结构成员 :
// 为了访问结构的成员,我们使用成员访问运算符(.)
sw qew;
qew->abb.a2;//结构体指针的成员变量访问符
s2 q;
q.abb.a2;
struct node qwe;
qwe.a3;
struct student stu5;
stu5.num;
return 0;
}
struct Books
{
char title[50];
char author[50];
char subject[100];
int book_id;
} book = {“C 语言”, “RUNOOB”, “编程语言”, 123456};
int main()
{
printf(“title : %s\nauthor: %s\nsubject: %s\nbook_id: %d\n”, book.title, book.author, book.subject, book.book_id);
}
======================================================================
建立一个学生结构体数组,有三个学生元素。
结构体里有四个成员:学号,姓名,出生年月日(也是结构体变量),成绩。
编程实现这三个学生所有信息的输入,输出,并求出成绩的平均值输出。
struct birth{
int year;
int month;
int day;
};
struct stu{
int numb;
char name[10];
struct birth a;
int score;
}student[5];
int main(){
double sum=0;
for(int i=0;i<3;i++){
scanf(“%d%s%d%d%d%d”,&student[i].numb,student[i].name,&student[i].a.year,&student[i].a.month,&student[i].a.day,&student[i].score);
}
for(int i=0;i<3;i++){
printf(“%d %s %d %d %d %d\n”,student[i].numb,student[i].name,student[i].a.year,student[i].a.month,student[i].a.day,student[i].score);
sum+=student[i].score;
}
printf(“成绩的平均值为:%.2lf”,sum/3);
}
input:
1 zhang 1900 1 1 90
2 wang 1901 1 1 90
3 gao 1920 1 1 90
感受:
其实我投简历的时候,都不太敢投递阿里。因为在阿里一面前已经过了字节的三次面试,投阿里的简历一直没被捞,所以以为简历就挂了。
特别感谢一面的面试官捞了我,给了我机会,同时也认可我的努力和态度。对比我的面经和其他大佬的面经,自己真的是运气好。别人8成实力,我可能8成运气。所以对我而言,我要继续加倍努力,弥补自己技术上的不足,以及与科班大佬们基础上的差距。希望自己能继续保持学习的热情,继续努力走下去。
也祝愿各位同学,都能找到自己心动的offer。
分享我在这次面试前所做的准备(刷题复习资料以及一些大佬们的学习笔记和学习路线),都已经整理成了电子文档
挂了。
特别感谢一面的面试官捞了我,给了我机会,同时也认可我的努力和态度。对比我的面经和其他大佬的面经,自己真的是运气好。别人8成实力,我可能8成运气。所以对我而言,我要继续加倍努力,弥补自己技术上的不足,以及与科班大佬们基础上的差距。希望自己能继续保持学习的热情,继续努力走下去。
也祝愿各位同学,都能找到自己心动的offer。
分享我在这次面试前所做的准备(刷题复习资料以及一些大佬们的学习笔记和学习路线),都已经整理成了电子文档
[外链图片转存中…(img-j6hHrh2S-1716567760452)]