当前位置:网站首页>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:

边栏推荐
- Hey, I had another fight with HR in the small group!
- 杭电多校-Slipper-(树图转化+虚点建图)
- Use serve to build a local server
- Polygon zkEVM network node
- 文件系统的简单操作
- 8. Haproxy builds a web cluster
- A Preliminary Study of RSS Subscription to WeChat Official Account-feed43
- 8.Haproxy 搭建Web集群
- How class only static allocation and dynamic allocation
- How to automatically export or capture abnormal login ip and logs in elastic to the database?
猜你喜欢
随机推荐
mq应用场景介绍
SQL query String field less than 10 how to check
技术解析|如何将 Pulsar 数据快速且无缝接入 Apache Doris
Simple operation of the file system
2022杭电多校联赛第五场 题解
docker+bridge+redis master-slave+sentry mode
How to automatically export or capture abnormal login ip and logs in elastic to the database?
SQL injection in #, - +, - % 20, % 23 is what mean?
基于 SSE 实现服务端消息主动推送解决方案
图像处理之Bolb分析(一)
Senior PHP development case (1) : use MYSQL statement across the table query cannot export all records of the solution
仿牛客论坛项目梳理
2.15 keil使用电脑端时间日期
什么是数字孪生智慧城市应用场景
如何动态添加script依赖的脚本
Gigabit 2 X light 8 electricity management industrial Ethernet switches WEB management - a key Ring Ring net switch
Basic form validation process
拿捏JVM性能优化(自己笔记版本)
docker安装mysql与宿主机相差8小时的问题。
Take care of JVM performance optimization (own note version)









