C语言数组写学生管理系统

学生管理系统.c文件

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<string.h>
#define MAX 100

struct student 
{
   
   
	char name[20];
	int num;
	double score[3];
	double sum;
};
struct pSysytem
{
   
   
	struct student stu[MAX];
	int curSize;
};
struct pSysytem* createsystem()
{
   
   
	struct pSysytem* psystem = (struct pSysytem*)calloc(sizeof(struct pSysytem), 1);
	return psystem;
}
void insertArray(struct pSysytem * pSystem,struct student stuinfo)
{
   
   
	if (pSystem->curSize == MAX)
	{
   
   
		printf("满了!!!!\n");
		return;
	}
	pSystem->stu[pSystem->curSize] = stuinfo;
	pSystem->curSize++;
}
//浏览信息
void printarray(struct pSysytem* pSystem)
{
   
   
	printf("姓名\t编号\t数学\t英语\t体育\t总分\n");
	for (int i = 0; i < pSystem->curSize; i++)
	{
   
   
		printf("%s\t%d\t",pSystem->stu[i].name,pSystem->stu[i].num);
		for (int k = 0; k < 3; k++)
		{
   
   
			printf("%.lf\t",pSystem->stu[i].score[k]);
		}
		printf("%.lf\n", pSystem->stu[i].sum);
	}
}
//录入信息
void intputstudent(struct pSysytem* pSystem)
{
   
   
	struct student temp;
	printf("请输入学生的姓名和编号:");
	scanf_s("%s%d", temp.name, 20, &temp.num);
	printf("请输入三门课成绩");
	temp.sum = 0;
	for (int i = 0; i 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

YUS云生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值