笔记
小森林同学
这个作者很懒,什么都没留下…
展开
-
利用C语言输入二进制转化成十进制。
#include<stdio.h>#include<string.h>#include<math.h>#define AS 20void qw(char ps[],int v);int u = 0;int main(void){ int p = 0; char as[AS]; while (1) { printf("请输入二进制数:"); gets_s(as, AS - 1); p = strlen(as); qw(as, p);.原创 2022-05-10 00:00:08 · 3749 阅读 · 2 评论 -
C语言编写预定机票程序
#include<stdio.h>#include<string.h>#define AS 12#define S 10struct as { int q[AS]; char w[AS]; char e[AS]; char t[AS];};void b(struct as* pc);void qq(void);void aa(void);void a(struct as ww[]);void c(struct as ee[]);int d(struc.原创 2022-05-04 23:18:09 · 1158 阅读 · 0 评论 -
【无标题】利用C语言结构体计算输入的每一位学生的平均分数,并存入结构体中。
#include<stdio.h>#include<stdlib.h>#include<string.h>#define AS 20#define ZX 15#define CSIZE 4struct aa { char q[AS]; char w[ZX];};struct student { struct aa name; float grade[AS]; float e[AS];};void san(void);void qq(str.原创 2022-05-02 23:38:18 · 1031 阅读 · 0 评论 -
C语言嵌套结构的编程
#include<stdio.h>#include<string.h>#define AS 5#define QW 20#define RR 2struct ww { char w[QW]; char e[QW]; char r[QW];};struct ss { char q[QW]; struct ww f;};void vv(struct ss *g);struct ss h[AS];int main(void){ char* ch; c.原创 2022-04-29 23:20:10 · 1141 阅读 · 0 评论 -
利用C语言结构体编写简易图书管理系统
#include<stdio.h>#include<stdlib.h>#include<string.h>#define AS 40#define QW 40#define ZX 100#define Y 10struct ss { char q[AS]; char w[QW]; float e;};struct ss as;void f(void);void x(struct ss cc[]);void p(struct ss nn[]).原创 2022-04-29 13:20:49 · 1350 阅读 · 0 评论 -
C语言,输入年月日,返回总天数,可改写成打印一个月中的假期天数。
#include<stdio.h>#include<string.h>#include<stdlib.h>#define AS 12#define QW 20#define SS 7struct as { char w[AS];};struct qw { int q; int h; int o;};struct yu { char* s[2]; char aa[2];};void qq(void);int gg(struct as .原创 2022-04-28 00:33:34 · 508 阅读 · 0 评论 -
【无标题】利用C语言建立文件并输入文件内容,在文件中显示行。
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<ctype.h>#define AS 40char* zx(char* cv, int n);int main(void){ char qw[AS]; char ty[AS]; FILE* as; errno_t er; char *ch; char yy; int w=0; printf("请输入文件...原创 2022-04-19 00:34:26 · 130 阅读 · 0 评论 -
利用C语言创建文件并输入文件内容。
#include<stdio.h>#include<stdlib.h>#include<string.h>#define AS 200char* ty(char* df, int n);int main(void){ FILE* as; char qw[AS]; char zx[AS]; char ch; errno_t er; printf("请输入文件名:"); ty(qw, AS); if ...原创 2022-04-19 00:24:19 · 3596 阅读 · 0 评论 -
c51 T0中断计数器,按下按钮LED灯依次亮
#include<reg51.h>unsigned char t;void timer0_() interrupt 1{ TH0=(256-1); TL0=(256-1); t++; switch(t) { case 1:P1=0xFE;break; case 2:P1=0xFC;break; case 3:P1=0xF8;break; case 4:P1=0xF0;break; case 5:P1=0xE0;break; case.原创 2021-12-24 11:39:02 · 595 阅读 · 0 评论 -
C51,利用定时器t0,设计时钟(通过led点亮方式显示)
采用中断扩展方式实现1 s定时。将内存单元30H、31H、32H分别作为时、分、秒单元,每当定时1 s到时,秒单元内容加1,同时秒指示灯闪;满60 s,则分单元加1,同时分指示灯闪;满60 min,则时单元加1,同时,时指示灯闪;满24 h后将时单元清“0”,同时熄灭所有指示灯。#include<reg52.h>sbit P1_0=P1^0;sbit P1_3=P1^3;sbit P1_7=P1^7;int i,y,a,b,o;void delayms (unsigned int原创 2021-12-19 19:42:51 · 1291 阅读 · 0 评论 -
C51 秒表设计,定时器查询法,精确到0.01秒
#include <reg52.h>#include <stdlib.h>#define uint unsigned long#define uchar unsigned charsbit N1 = P1^4;sbit N2 = P1^5;sbit N3 = P1^6;sbit N4 = P1^7;sbit A1 = P3^1;sbit A2 = P3^0;sbit A3 = P3^2;uchar code table[]={0xc0,0xf9,0xa4,0..原创 2021-12-19 16:49:59 · 1395 阅读 · 1 评论 -
C51 ISIS仿真 ,外部中断嵌套
高、低优先级中断服务程序嵌套。Proteus仿真电路,在8051单片机外部中断、端分别通过两个按键接地,单片机的P0、P1、P2口分别接3个共阳极LED数码管。将设置为高优先级,设置为低优先级,负边沿触发。主程序在开中断后进入循环状态,通过P0口循环显示“1”~“8”字符,此时无论按下“低优先级”或“高优先级”按键,主程序都会被中断,进入中断服务程序,通过P2或P1口显示“1”~“8”字符。如果先按下“低优先级”按键,则P0口的显示将停在某一数字,进入低优先级中断服务程序,通过P2口显示“1”~“8”字原创 2021-12-16 23:36:38 · 1195 阅读 · 0 评论 -
C51 isis仿真 外部中断扩展,利用LED指示灯显示
#include<reg52.h>sbit P1_1=P1^1;sbit P1_3=P1^3;sbit P1_0=P1^0;sbit P1_2=P1^2;void timer0( ) interrupt 0{ TCON=0x00; if(P1_0==1) { P1_1=0; } if(P1_2==1) { P1_3=0; }}void timer1 ( ) interrupt 2{ TCON=0x00; P1=0xFF; }int ..原创 2021-12-15 23:26:50 · 783 阅读 · 0 评论