录入查询学生成绩C语言,学生成绩录入查询删除等c语言编程(国外英文资料).doc...

[摘要]学生成绩录入查询删除等c语言编程(国外英文资料) 5.3.1 # include < stdio, h > # include < string. H > # include < stdlib. H > # include < conio. H > The number of bytes of the (struct student) / * student structure is * / Define FORMAT (s) [I], stu [I].stu [I].stu [I]. [I] # define N 40 / * symbol constant: class number * / Float Fc, Fm, Fe; / * global variables: c-language scores, high scores, English grades * / Struct student / * defines student achievement structure * / { Int num. / * school number * / Char name [15]. / * name * / Double c; / * C language course results * / Double m; / * a high number of courses Double e; / * in English Double sum; / * total score * / } stu [N]. / * define the structure of the structure. * / Void (in); / * to enter student achievement information * / Void the show (); / * shows students' achievements * / Void the order (); / * in the aggregate order * / Void del (); / * deletes student achievement information * / Void the modify (); / * to modify student achievement information * / Void menu (); / * main menu * / Void total (); / * the total number of people is * / Void the search (); / * look for student information * / 5.3.2 Void menu () / * custom function implements menu function * / { System (" CLS "); / * clear screen function * / Printf (" \ n \ n \ n \ n \ n "); Printf (" \ t \ t | -- -- -- -- -| \ n "); Printf (" \ t \ t | \ t 1. "); Printf (" \ t \ t | \ t 2. Query the student achievement information | \ n "); Printf (" \ t \ t | \ t 3. Delete the student achievement information | \ n "); Printf (" \ t \ t | \ t 4. Modify the student achievement information | \ n "); Printf (" \ t \ t | \ t 5. The student grade is sorted | \ n "); Printf (" \ t \ t, | \ t 6. Statistics amount | \ n "); Printf (" \ t \ t | \ t 0. Exit | \ n "); Printf (" \ t \ t \ t | -- -- - | \ n \ n); Printf (" \ t \ t \ t, "(0-6) : } Void main ()/the main function * / { Int n; The menu (); Scanf (" % d ", & n); / * input selection function number * / While (n) { The switch

bb5b93261a8e0acfdfa888ebcf3b163b.png

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是C语言实现学生成绩录入、输出和按成绩查询学生信息的示例代码: ```c #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_STUDENTS 100 struct student { char name[20]; int score; }; struct student students[MAX_STUDENTS]; int num_students = 0; // 录入学生成绩 void add_student() { if (num_students >= MAX_STUDENTS) { printf("Error: Too many students!\n"); return; } struct student s; printf("Enter name: "); scanf("%s", s.name); printf("Enter score: "); scanf("%d", &s.score); students[num_students++] = s; } // 输出学生成绩 void list_students() { printf("Name\tScore\n"); for (int i = 0; i < num_students; i++) { printf("%s\t%d\n", students[i].name, students[i].score); } } // 按成绩查询学生信息 void find_students() { int min_score, max_score; printf("Enter min score: "); scanf("%d", &min_score); printf("Enter max score: "); scanf("%d", &max_score); printf("Name\tScore\n"); for (int i = 0; i < num_students; i++) { if (students[i].score >= min_score && students[i].score <= max_score) { printf("%s\t%d\n", students[i].name, students[i].score); } } } int main() { int choice; do { printf("\n"); printf("1. Add student\n"); printf("2. List students\n"); printf("3. Find students by score\n"); printf("4. Exit\n"); printf("Enter choice: "); scanf("%d", &choice); switch (choice) { case 1: add_student(); break; case 2: list_students(); break; case 3: find_students(); break; case 4: printf("Goodbye!\n"); break; default: printf("Invalid choice!\n"); break; } } while (choice != 4); return 0; } ``` 在这个示例代码中,我们使用了一个结构体来表示学生信息,包括姓名和成绩。我们使用一个全局数组 `students` 来保存所有学生的信息,其中 `num_students` 表示已经录入学生数量。 在主函数中,我们使用一个循环来接受用户输入的操作,并根据用户的选择调用不同的函数。`add_student` 函数用来录入学生成绩,`list_students` 函数用来输出学生成绩,`find_students` 函数用来按成绩查询学生信息。 这个示例代码只是一个简单的例子,实际开发中可能需要更多的功能和更严格的输入检查。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值