当前位置:网站首页>C student management system Find student nodes based on student ID
C student management system Find student nodes based on student ID
2022-08-05 02:19:00 【joker_0030】
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include <string.h>
//学生节点.
typedef struct _STU
{
char arrStuNum[10];
char arrStuName[10];
int iStuScore;
struct _STU* pNext;//指向下一个节点.
}STUNODE;
//申明链表的头和尾.
STUNODE* g_pHead = NULL;
STUNODE* g_pEnd = NULL;
//Find student information at a given location.
STUNODE* FindStuByNum(char* arrStuNum);
int main()
{
int nOrder = -1;
char arrStuNum[10] = { '\0' };
char arrStuName[10] = { '\0' };
int iStuScore = -1;
int nFlag = 1;
//显示指令.
ShowOrder();
while (nFlag)
{
printf("请输入操作指令(0为查看指令)\n");
scanf("%d", &nOrder);
switch (nOrder)
{
case 1://添加一个学生信息.
printf("输入学号:");
scanf("%s", arrStuNum);
printf("输入姓名:");
scanf("%s", arrStuName);
printf("输入分数:");
scanf("%d", &iStuScore);//取地址.
AddStuMSG(arrStuNum, arrStuName, iStuScore);
break;
case 10://头添加.
printf("输入学号:");
scanf("%s", arrStuNum);
printf("输入姓名:");
scanf("%s", arrStuName);
printf("输入分数:");
scanf("%d", &iStuScore);//取地址.
AddStuMSGToLinkHead(arrStuNum, arrStuName, iStuScore);
break;
case 11://指定位置添加.
printf("Enter the student number you want to find:");
scanf("%s", arrStuNum);
if (NULL != FindStuByNum(arrStuNum));
{
//插入.
}
break;
case 2:
printf("请输入学生学号/姓名");
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8://打印数据(链表).
ShowStuData();
break;
case 9:
nFlag = 0;
break;
case 0:
//查看指令.
ShowOrder();
break;
default:
printf("输入的指令不对");
break;
}
}
//释放链表.
FreeLinkData();
system("pause");
return 0;
}
STUNODE* FindStuByNum(char* arrStuNum)
{
STUNODE* pTemp = g_pHead;
//检测参数的合法性.
if (NULL == arrStuNum)
{
printf("学号输入错误!\n");
return NULL;
}
//判断链表是否为空.
if (NULL == g_pHead || NULL == g_pEnd)
{
printf("链表为NULL!\n");
return NULL;
}
//遍历链表.
while (pTemp != NULL)
{
if (0 == strcmp(pTemp->arrStuNum, arrStuNum))
{
return pTemp;
}
pTemp = pTemp->pNext;
}
printf("查无此节点!\n");
return NULL;
}
边栏推荐
- .Net C# Console Create a window using Win32 API
- "Configuration" is a double-edged sword, it will take you to understand various configuration methods
- 使用OpenVINO实现飞桨版PGNet推理程序
- RAID磁盘阵列
- LeetCode uses the minimum cost to climb the stairs----dp problem
- 《.NET物联网从零开始》系列
- C语言实现简单猜数字游戏
- 线性表的查找
- 释放技术创新引擎,英特尔携手生态合作伙伴推动智慧零售蓬勃发展
- C学生管理系统 头添加学生节点
猜你喜欢
ROS通信 —— 服务(Service)通信](/img/4d/4657f24bd7809abb4bdc4b418076f7.png)
[ROS](10)ROS通信 —— 服务(Service)通信

J9数字货币论:web3的创作者经济是什么?

01 【前言 基础使用 核心概念】

How do programmers without objects spend the Chinese Valentine's Day

How to simply implement the quantization and compression of the model based on the OpenVINO POT tool

<开发>实用工具

Flink 1.15.1 集群搭建(StandaloneSession)

02 【开发服务器 资源模块】

一文看懂推荐系统:召回06:双塔模型——模型结构、训练方法,召回模型是后期融合特征,排序模型是前期融合特征

MySQL learning
随机推荐
HOG feature study notes
使用OpenVINO实现飞桨版PGNet推理程序
fragment可见性判断
高数_复习_第1章:函数、极限、连续
Xunrui cms website cannot be displayed normally after relocation and server change
基于OpenVINO工具套件简单实现YOLOv7预训练模型的部署
.Net C# 控制台 使用 Win32 API 创建一个窗口
在这个超连接的世界里,你的数据安全吗
"Configuration" is a double-edged sword, it will take you to understand various configuration methods
【genius_platform软件平台开发】第七十六讲:vs预处理器定义的牛逼写法!!!!(其他组牛逼conding人员告知这么配置来取消宏定义)
Transfer Learning - Joint Geometrical and Statistical Alignment for Visual Domain Adaptation
后期学习计划
SuperMap iDesktop.Net之布尔运算求交——修复含拓扑错误复杂模型
亚马逊云科技 + 英特尔 + 中科创达为行业客户构建 AIoT 平台
力扣-二叉树的最大的深度
亚马逊云科技携手中科创达为行业客户构建AIoT平台
Flink 1.15.1 集群搭建(StandaloneSession)
hypervisor相关的知识点
树表的查找
1349. 参加考试的最大学生数 状态压缩