当前位置:网站首页>Structure function exercise
Structure function exercise
2022-08-04 04:15:00 【BSP Junior Primary School Monk】
1. Write a program to complete the function of querying grades according to the student's name (requires the query to be implemented through a function),
Define a student structure, including name, grade, define a structure array, save all the students' results
Information (assuming there are 3 students), first enter the student information, and then call the query function to obtain the student's grades to be queried
/*3. Write a program to complete the function of querying the results according to the student's name (requires the query to be implemented through a function),Define a student structure, including name, grade, define a structure array, save all studentsInformation (assuming there are 3 students), first enter the student information, and then call the query function to obtain the student's grades to be queried*/#include #include #include typedef struct{char name[10];float score;}STU;void struct_input(STU arr[],int n){for(int i=0;i Run result:

2. Implement addition, deletion, modification, and query operations on a structure array
#include #include #include typedef struct{int num;char name[20];char sex;float score;}boy;boy boy_test[6]={{101,"li ping",'m',45},{102,"zhang ping",'m',62.5},{103,"he feng",'m',92.5},{104,"cheng li",'f',87},{106,"wang ming",'m',58},};void struct_print(boy *p01,int n){printf("\n");printf("Student ID\tName\tGender\tScore\n");for(int i=0;i Run result:

边栏推荐
猜你喜欢
随机推荐
缓存穿透、缓存击穿、缓存雪崩以及解决方案
Polygon zkEVM network node
目标检测-中篇
4-way two-way HDMI integrated business high-definition video optical transceiver 8-way HDMI high-definition video optical transceiver
Shell 函数
深度学习——以CNN服装图像分类为例,探讨怎样评价神经网络模型
基本表单验证流程
【技巧】借助Sentinel实现请求的优先处理
外卖店优先级
A Preliminary Study of RSS Subscription to WeChat Official Account-feed43
系统设计.如何设计一个秒杀系统(完整版 转)
企业直播风起:目睹聚焦产品,微赞拥抱生态
杭电多校-Slipper-(树图转化+虚点建图)
7-1 LVS+NAT load balancing cluster, NAT mode deployment
Functions, recursion and simple dom operations
十一种概率分布
怎么把elastic中的异常登录ip和日志自动导出或抓取到数据库中?
2.15 keil使用电脑端时间日期
JVM Notes
内网服务器访问远程服务器的端口映射









