6.27-6.29 旧c语言
#include<stdio.h>
struct stu
{int num;float score;struct stu *next;
};
void main()
{struct stu a,b,c,*head;//静态链表a.num = 1;a.score = 10;b.num = 2;b.score = 20;c.num = 3;c.score = 30;head = &a;a.next = &b;b.next = &c;do{printf("%d,%5.1f\n",head->num,head->score);head = head->next;}while(head != NULL);
}


#include<stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct stu)
int n;
struct stu
{int num;float score;struct stu *next;
};
struct stu *creat()//建立动态链表
{struct stu *p1,*p2,*head;p1 = p2 = (struct stu *)malloc(LEN);printf("input num:\n");scanf("%d",&p1->num);printf("input score:\n");scanf("%f",&p1->score);head = NULL,n = 0;while(p1->num != 0){n++;if(n == 1){head = p1;}else{p2->next = p1;}p2 = p1;//p1 = (struct stu *)malloc(LEN);printf("input num:\n");scanf("%d",&p1->num);printf("input score:\n");scanf("%f",&p1->score);}p2->next = NULL;return head;}
void print(struct stu *head)
{struct stu *p;printf("there are %d record stu\n",n);p = head;if(head != NULL){do{printf("num = %d,score = %f\n",p->num,p->score);p = p->next;}while(p);//直到p为空结点退出循环}
}
void main()
{struct stu *p;p = creat();print(p);
}

#include<stdio.h>//增删改查
#include<stdlib.h>
#define LEN sizeof(struct stu)
struct stu *del(struct stu *head,int n);
struct stu *creat();
void print(struct stu *head);
int n;
struct stu
{int num;float score;struct stu *next;
};
struct stu *del(struct stu *head,int m)
{struct stu *p1,*p2;p1 = head;if(head == NULL)//判断是否为空链表{printf("this is kong node\n");return NULL;}while(p1->num != m && p1->next != NULL)//删除的值不是当前结点,且当前结点不为尾节点{p2 = p1;p1 = p1->next;}if(p1->num == m)//找到节点{if(p1 == head)//如果当前节点为头结点{head = p1->next;}else//此时为普通结点{p2->next = p1->next;}printf("del NO:%d success!\n",m);n = n-1;}else{printf("%d no found!\n",n);}return head;
}
struct stu *creat()
{struct stu *p1,*p2,*head;p1 = p2 = (struct stu *)malloc(LEN);printf("input num:\n");scanf("%d",&p1->num);printf("input score:\n");scanf("%f",&p1->score);head = NULL,n = 0;while(p1->num != 0){n++;if(n == 1){head = p1;}else{p2->next = p1;}p2 = p1;p1 = (struct stu *)malloc(LEN);printf("input num:\n");scanf("%d",&p1->num);printf("input score:\n");scanf("%f",&p1->score);}p2->next = NULL;return head;}
void print(struct stu *head)
{struct stu *p;printf("there are %d record stu\n",n);p = head;if(head != NULL){do{printf("num = %d,score = %f\n",p->num,p->score);p = p->next;}while(p);}
}
void main()
{struct stu *stu,*p;int k;stu = creat();p = stu;print(p);printf("del num is:\n");scanf("%d",&k);print(del(p,k));
}


#include<stdio.h>
#include<stdlib.h>
#define LEN sizeof(struct stu)
struct stu *del(struct stu *head,int n);
struct stu *creat();
void print(struct stu *head);
struct stu *inser(struct stu *head,struct stu *ins);
struct stu *lookfor(struct stu *head,struct stu *look);
struct stu *wrilink(struct stu *head,struct stu *stu4);
struct stu
{int num;float score;struct stu *next;
};
int n;
struct stu *wrilink(struct stu *head,struct stu *stu4)
{struct stu *p;p = head;if(head == NULL){printf("无数据可修改!\n");}else{while(p != NULL){if(p->num == stu4->num){p->score = stu4->score;}p = p->next;}}return head;
}
struct stu *lookfor(struct stu *head,struct stu *look)
{struct stu *p;p = head;if(p == NULL){printf("没有数据!\n");}else{while(p != NULL){if(p->num == look->num){printf("找到第%d个数据,分数为%f\n",p->num,p->score);}p = p->next;}}return head;
}
struct stu *inser(struct stu *head,struct stu *ins)
{struct stu *p1,*p2,*p0;p0 = ins;p1 = head;if(head == NULL){head = p0;p0->next = NULL;}else{while((p0->num >p1->num) && (p1->next != NULL)){p2 = p1;p1 = p1->next;}if(p0->num <= p1->num){if(p1 == head){head = p0;}else{p2->next = p0;}p0->next = p1;}else{p1->next = p0;p0->next = NULL;}n = n+1;return head;}
}
struct stu *del(struct stu *head,int m)
{struct stu *p1,*p2;p1 = head;if(head == NULL){printf("this is kong node\n");return NULL;}while(p1->num != m && p1->next != NULL){p2 = p1;p1 = p1->next;}if(p1->num == m){if(p1 == head){head = p1->next;}else{p2->next = p1->next;}printf("del NO:%d success!\n",m);n = n-1;}else{printf("%d no found!\n",n);}return head;
}
struct stu *creat()
{struct stu *p1,*p2,*head;p1 = p2 = (struct stu *)malloc(LEN);printf("input num:\n");scanf("%d",&p1->num);printf("input score:\n");scanf("%f",&p1->score);head = NULL,n = 0;while(p1->num != 0){n++;if(n == 1){head = p1;}else{p2->next = p1;}p2 = p1;p1 = (struct stu *)malloc(LEN);printf("input num:\n");scanf("%d",&p1->num);printf("input score:\n");scanf("%f",&p1->score);}p2->next = NULL;return head;}
void print(struct stu *head)
{struct stu *p;printf("there are %d record stu\n",n);p = head;if(head != NULL){do{printf("num = %d,score = %f\n",p->num,p->score);p = p->next;}while(p != NULL);}
}
void main()
{struct stu *stu,*p,stu2,stu3,stu4;int k;stu = creat();p = stu;print(p);printf("del num is:\n");scanf("%d",&k);print(del(p,k));printf("insert into the num:");scanf("%d",&stu2.num);printf("insert into the score:");scanf("%f",&stu2.score);p = inser(stu,&stu2);print(p);printf("请输入查找的数据是:");scanf("%d",&stu3.num);lookfor(stu,&stu3);printf("请输入修改的学号:");scanf("%d",&stu4.num);printf("请输入修改的学号数据:");scanf("%f",&stu4.score);p = wrilink(stu,&stu4);print(p);
}
typedef 声明新的类型名来代替已有的类型名,有利于程序通用与移植
#include<stdio.h>
typedef struct
{int year;int month;int day;
}date;
void main()
{date da;da.year = 1995;da.month = 8;da.day = 9;printf("%d--%d--%d\n",da.year,da.month,da.day);
}
#include<stdio.h>
typedef int num[100];//声明um为整型数组类型
void main()
{num n = {0};printf("%d\n",sizeof(n));
}
#include<stdio.h>
typedef void (*p)();
void fun()
{printf("funny\n");
}
void main()
{p p1;p1 = fun;//函数指针指向函数的入口p1();
}



相关文章:
6.27-6.29 旧c语言
#include<stdio.h> struct stu {int num;float score;struct stu *next; }; void main() {struct stu a,b,c,*head;//静态链表a.num 1;a.score 10;b.num 2;b.score 20;c.num 3;c.score 30;head &a;a.next &b;b.next &c;do{printf("%d,%5.1f\n&…...
Unidbg调用-补环境V3-Hook
结合IDA和unidbg,可以在so的执行过程进行Hook,这样可以让我们了解并分析具体的执行步骤。 应用场景:基于unidbg调试执行步骤 或 还原算法(以Hookzz为例)。 1.大姨妈 1.1 0x1DA0 public void hook1() {...
从AICore到TensorCore:华为910B与NVIDIA A100全面分析
华为NPU 910B与NVIDIA GPU A100性能对比,从AICore到TensorCore,展现各自计算核心优势。 AI 2.0浪潮汹涌而来,若仍将其与区块链等量齐观,视作炒作泡沫,则将错失新时代的巨大机遇。现在,就是把握AI时代的关键…...
Edge 浏览器退出后,后台占用问题
Edge 浏览器退出后,后台占用问题 环境 windows 11 Microsoft Edge版本 126.0.2592.68 (正式版本) (64 位)详情 在关闭Edge软件后,查看后台,还占用很多系统资源。实在不明白,关了浏览器还不能全关了,微软也学流氓了。…...
实验八 T_SQL编程
题目 以电子商务系统数据库ecommerce为例 1、在ecommerce数据库,针对会员表member首先创建一个“呼和浩特地区”会员的视图view_hohhot,然后通过该视图查询来自“呼和浩特”地区的会员信息,用批处理命令语句将问题进行分割,并分…...
【爆肝34万字】从零开始学Python第2天: 判断语句【入门到放弃】
目录 前言判断语句True、False简单使用作用 比较运算符引入比较运算符的分类比较运算符的结果示例代码总结 逻辑运算符引入逻辑运算符的简单使用逻辑运算符与比较运算符一起使用特殊情况下的逻辑运算符 if 判断语句引入基本使用案例演示案例补充随堂练习 else 判断子句引入else…...
React 19 新特性集合
前言:https://juejin.cn/post/7337207433868197915 新 React 版本信息 伴随 React v19 Beta 的发布,React v18.3 也一并发布。 React v18.3相比最后一个 React v18 的版本 v18.2 ,v18.3 添加了一些警告提示,便于尽早发现问题&a…...
耐高温水位传感器有哪些
耐高温水位传感器在现代液位检测技术中扮演着重要角色,特别适用于需要高温环境下稳定工作的应用场合。这类传感器的设计和材质选择对其性能和可靠性至关重要。 一种典型的耐高温水位传感器是FS-IR2016D,它采用了PPSU作为主要材质。PPSU具有优良的耐高温…...
Symfony国际化与本地化:打造多语言应用的秘诀
标题:Symfony国际化与本地化:打造多语言应用的秘诀 摘要 Symfony是一个高度灵活的PHP框架,用于创建Web应用程序。它提供了强大的国际化(i18n)和本地化(l10n)功能,允许开发者轻松创…...
ApolloClient GraphQL 与 ReactNative
要在 React Native 应用程序中设置使用 GraphQL 的简单示例,您需要遵循以下步骤: 设置一个 React Native 项目。安装 GraphQL 必要的依赖项。创建一个基本的 GraphQL 服务器(或使用公共 GraphQL 端点)。从 React Native 应用中的…...
【贡献法】2262. 字符串的总引力
本文涉及知识点 贡献法 LeetCode2262. 字符串的总引力 字符串的 引力 定义为:字符串中 不同 字符的数量。 例如,“abbca” 的引力为 3 ,因为其中有 3 个不同字符 ‘a’、‘b’ 和 ‘c’ 。 给你一个字符串 s ,返回 其所有子字符…...
C#基于SkiaSharp实现印章管理(3)
本系列第一篇文章中创建的基本框架限定了印章形状为矩形,但常用的印章有方形、圆形等多种形状,本文调整程序以支持定义并显示矩形、圆角矩形、圆形、椭圆等4种形式的印章背景形状。 定义印章背景形状枚举类型,矩形、圆形、椭圆相关的尺寸…...
如何理解泛型的编译期检查
既然说类型变量会在编译的时候擦除掉,那为什么我们往 ArrayList 创建的对象中添加整数会报错呢?不是说泛型变量String会在编译的时候变为Object类型吗?为什么不能存别的类型呢?既然类型擦除了,如何保证我们只能使用泛型…...
计算机组成原理:海明校验
在上图中,对绿色的7比特数据进行海明校验,需要添加紫色的4比特校验位,总共是蓝色的11比特。紫色的校验位pi分布于蓝色的hi的1, 2, 4, 8, 16, 32, 64位,是2i-1位。绿色的数据位bi分布于剩下的位。 在下图中,b1位于h3&a…...
信息学奥赛初赛天天练-39-CSP-J2021基础题-哈夫曼树、哈夫曼编码、贪心算法、满二叉树、完全二叉树、前中后缀表达式转换
PDF文档公众号回复关键字:20240629 2022 CSP-J 选择题 单项选择题(共15题,每题2分,共计30分:每题有且仅有一个正确选项) 5.对于入栈顺序为a,b,c,d,e的序列,下列( )不合法的出栈序列 A. a,b&a…...
第11章 规划过程组(收集需求)
第11章 规划过程组(一)11.3收集需求,在第三版教材第377~378页; 文字图片音频方式 第一个知识点:主要输出 1、需求跟踪矩阵 内容 业务需要、机会、目的和目标 项目目标 项目范围和 WBS 可…...
探索WebKit的守护神:深入Web安全策略
探索WebKit的守护神:深入Web安全策略 在数字化时代,网络已成为我们生活的一部分,而网页浏览器作为我们探索网络世界的窗口,其安全性至关重要。WebKit作为众多流行浏览器的内核,例如Safari,其安全性策略是保…...
unity ScrollRect裁剪ParticleSystem粒子
搜了下大概有这几种方法 通过模板缓存通过shader裁剪区域:案例一,案例二,案例三,三个案例都是类似的方法,需要在c#传入数据到shader通过插件 某乎上的模板缓存方法link,(没有登录看不到全文&a…...
凤仪亭 | 第7集 | 大丈夫生居天地之间,岂能郁郁久居人下 | 司徒一言,令我拨云见日,茅塞顿开 | 三国演义 | 逐鹿群雄
🙋大家好!我是毛毛张! 🌈个人首页: 神马都会亿点点的毛毛张 📌这篇博客分享的是《三国演义》文学剧本第Ⅰ部分《群雄逐鹿》的第7️⃣集《凤仪亭》的经典语句和文学剧本全集台词 文章目录 1.经典语句2.文学剧本台词 …...
React实战学习(一)_棋盘设计
需求: 左上侧:状态左下侧:棋盘,保证胜利就结束 和 下过来的不能在下右侧:“时光机”,保证可以回顾,索引 语法: 父子之间属性传递(props)子父组件传递(写法上&…...
接口测试中缓存处理策略
在接口测试中,缓存处理策略是一个关键环节,直接影响测试结果的准确性和可靠性。合理的缓存处理策略能够确保测试环境的一致性,避免因缓存数据导致的测试偏差。以下是接口测试中常见的缓存处理策略及其详细说明: 一、缓存处理的核…...
visual studio 2022更改主题为深色
visual studio 2022更改主题为深色 点击visual studio 上方的 工具-> 选项 在选项窗口中,选择 环境 -> 常规 ,将其中的颜色主题改成深色 点击确定,更改完成...
生成 Git SSH 证书
🔑 1. 生成 SSH 密钥对 在终端(Windows 使用 Git Bash,Mac/Linux 使用 Terminal)执行命令: ssh-keygen -t rsa -b 4096 -C "your_emailexample.com" 参数说明: -t rsa&#x…...
苍穹外卖--缓存菜品
1.问题说明 用户端小程序展示的菜品数据都是通过查询数据库获得,如果用户端访问量比较大,数据库访问压力随之增大 2.实现思路 通过Redis来缓存菜品数据,减少数据库查询操作。 缓存逻辑分析: ①每个分类下的菜品保持一份缓存数据…...
【android bluetooth 框架分析 04】【bt-framework 层详解 1】【BluetoothProperties介绍】
1. BluetoothProperties介绍 libsysprop/srcs/android/sysprop/BluetoothProperties.sysprop BluetoothProperties.sysprop 是 Android AOSP 中的一种 系统属性定义文件(System Property Definition File),用于声明和管理 Bluetooth 模块相…...
鸿蒙中用HarmonyOS SDK应用服务 HarmonyOS5开发一个生活电费的缴纳和查询小程序
一、项目初始化与配置 1. 创建项目 ohpm init harmony/utility-payment-app 2. 配置权限 // module.json5 {"requestPermissions": [{"name": "ohos.permission.INTERNET"},{"name": "ohos.permission.GET_NETWORK_INFO"…...
BCS 2025|百度副总裁陈洋:智能体在安全领域的应用实践
6月5日,2025全球数字经济大会数字安全主论坛暨北京网络安全大会在国家会议中心隆重开幕。百度副总裁陈洋受邀出席,并作《智能体在安全领域的应用实践》主题演讲,分享了在智能体在安全领域的突破性实践。他指出,百度通过将安全能力…...
JVM暂停(Stop-The-World,STW)的原因分类及对应排查方案
JVM暂停(Stop-The-World,STW)的完整原因分类及对应排查方案,结合JVM运行机制和常见故障场景整理而成: 一、GC相关暂停 1. 安全点(Safepoint)阻塞 现象:JVM暂停但无GC日志,日志显示No GCs detected。原因:JVM等待所有线程进入安全点(如…...
JS设计模式(4):观察者模式
JS设计模式(4):观察者模式 一、引入 在开发中,我们经常会遇到这样的场景:一个对象的状态变化需要自动通知其他对象,比如: 电商平台中,商品库存变化时需要通知所有订阅该商品的用户;新闻网站中࿰…...
从“安全密码”到测试体系:Gitee Test 赋能关键领域软件质量保障
关键领域软件测试的"安全密码":Gitee Test如何破解行业痛点 在数字化浪潮席卷全球的今天,软件系统已成为国家关键领域的"神经中枢"。从国防军工到能源电力,从金融交易到交通管控,这些关乎国计民生的关键领域…...
