虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

d<b>gf</b>d<b>gf</b>dgdfs

  • 单片机应用技术(C语言版)第3版程序源代码

    主要程序代码有 单片机与LED数码管接口 LED大屏幕显示器和接口 字符LCD 液晶显示和接口 单片机与键盘接口 A/D转换器接口 D/A 转换器接口 串行通信基础 MCS-51的串行接口 MCS-51单片机双机通信 RS-232C串行通信总线标准及其接口 存储器的扩展 串行口的I/O口扩展 数字钟的设计与制作 单片机温度检测记录系统

    标签: 单片机 程序源代码

    上传时间: 2016-04-12

    上传用户:eruth

  • 运动会源代码

    #include <malloc.h>       #include <stdio.h>       #include <stdlib.h>       #include <string.h>       #define NULL 0      #define MaxSize 30          typedef struct athletestruct /*运动员*/     {         char name[20];          int score; /*分数*/         int range; /**/         int item; /*项目*/     }ATH;     typedef struct schoolstruct /*学校*/     {         int count; /*编号*/         int serial; /**/          int menscore; /*男选手分数*/         int womenscore; /*女选手分数*/         int totalscore; /*总分*/         ATH athlete[MaxSize]; /**/         struct schoolstruct *next;      }SCH;         int nsc,msp,wsp;      int ntsp;      int i,j;      int overgame;      int serial,range;      int n;      SCH *head,*pfirst,*psecond;      int *phead=NULL,*pafirst=NULL,*pasecond=NULL;     void create();         void input ()     {         char answer;          head = (SCH *)malloc(sizeof(SCH)); /**/         head->next = NULL;         pfirst = head;          answer = 'y';         while ( answer == 'y' )         {         Is_Game_DoMain:         printf("\nGET Top 5 when odd\nGET Top 3 when even");         printf("\n输入运动项目序号 (x<=%d):",ntsp);         scanf("%d",pafirst);         overgame = *pafirst;         if ( pafirst != phead )         {             for ( pasecond = phead ; pasecond < pafirst ; pasecond ++ )             {                 if ( overgame == *pasecond )                 {                     printf("\n这个项目已经存在请选择其他的数字\n");                     goto Is_Game_DoMain;                 }             }         }         pafirst = pafirst + 1;         if ( overgame > ntsp )         {             printf("\n项目不存在");             printf("\n请重新输入");             goto Is_Game_DoMain;         }         switch ( overgame%2 )         {         case 0: n = 3;break;         case 1: n = 5;break;         }         for ( i = 1 ; i <= n ; i++ )         {         Is_Serial_DoMain:         printf("\n输入序号 of the NO.%d (0<x<=%d): ",i,nsc);                 scanf("%d",&serial);         if ( serial > nsc )          {             printf("\n超过学校数目,请重新输入");             goto Is_Serial_DoMain;         }         if ( head->next == NULL )          {             create();         }         psecond = head->next ;          while ( psecond != NULL )          {             if ( psecond->serial == serial )             {                 pfirst = psecond;                 pfirst->count = pfirst->count + 1;                 goto Store_Data;             }             else             {                 psecond = psecond->next;             }         }         create();         Store_Data:                 pfirst->athlete[pfirst->count].item = overgame;         pfirst->athlete[pfirst->count].range = i;         pfirst->serial = serial;         printf("Input name:) : ");                 scanf("%s",pfirst->athlete[pfirst->count].name);         }         printf("\n继续输入运动项目(y&n)?");         answer = getchar();         printf("\n");         }     }         void calculate() /**/     {         pfirst = head->next;         while ( pfirst->next != NULL )         {             for (i=1;i<=pfirst->count;i++)             {                 if ( pfirst->athlete[i].item % 2 == 0 )                  {                     switch (pfirst->athlete[i].range)                     {                     case 1:pfirst->athlete[i].score = 5;break;                     case 2:pfirst->athlete[i].score = 3;break;                     case 3:pfirst->athlete[i].score = 2;break;                     }                 }                 else                  {                     switch (pfirst->athlete[i].range)                     {                     case 1:pfirst->athlete[i].score = 7;break;                     case 2:pfirst->athlete[i].score = 5;break;                     case 3:pfirst->athlete[i].score = 3;break;                     case 4:pfirst->athlete[i].score = 2;break;                     case 5:pfirst->athlete[i].score = 1;break;                     }                 }                 if ( pfirst->athlete[i].item <=msp )                  {                     pfirst->menscore = pfirst->menscore + pfirst->athlete[i].score;                 }                 else                  {                     pfirst->womenscore = pfirst->womenscore + pfirst->athlete[i].score;                 }             }             pfirst->totalscore = pfirst->menscore + pfirst->womenscore;             pfirst = pfirst->next;         }     }         void output()     {         pfirst = head->next;         psecond = head->next;         while ( pfirst->next != NULL )          {             // clrscr();              printf("\n第%d号学校的结果成绩:",pfirst->serial);             printf("\n\n项目的数目\t学校的名字\t分数");             for (i=1;i<=ntsp;i++)              {                 for (j=1;j<=pfirst->count;j++)                  {                     if ( pfirst->athlete[j].item == i )                     {                                                                         printf("\n %d\t\t\t\t\t\t%s\n %d",i,pfirst->athlete[j].name,pfirst->athlete[j].score);break;                                             }                 }             }             printf("\n\n\n\t\t\t\t\t\t按任意建 进入下一页");             getchar();             pfirst = pfirst->next;         }     //  clrscr();          printf("\n运动会结果:\n\n学校编号\t男运动员成绩\t女运动员成绩\t总分");         pfirst = head->next;         while ( pfirst->next != NULL )         {             printf("\n %d\t\t %d\t\t %d\t\t %d",pfirst->serial,pfirst->menscore,pfirst->womenscore,pfirst->totalscore);             pfirst = pfirst->next;         }         printf("\n\n\n\t\t\t\t\t\t\t按任意建结束");         getchar();     }         void create()     {                 pfirst = (struct schoolstruct *)malloc(sizeof(struct schoolstruct));         pfirst->next = head->next ;         head->next = pfirst ;                 pfirst->count = 1;         pfirst->menscore = 0;         pfirst->womenscore = 0;         pfirst->totalscore = 0;     }     void Save()     {FILE *fp;     if((fp = fopen("school.dat","wb"))==NULL)     {printf("can't open school.dat\n");     fclose(fp);     return;     }     fwrite(pfirst,sizeof(SCH),10,fp);     fclose(fp);     printf("文件已经成功保存\n");     }         void main()     {         system("cls");         printf("\n\t\t\t 运动会分数统计\n");         printf("输入学校数目 (x>= 5):");         scanf("%d",&nsc);          printf("输入男选手的项目(x<=20):");         scanf("%d",&msp);          printf("输入女选手项目(<=20):");         scanf("%d",&wsp);          ntsp = msp + wsp;                  phead = (int *)calloc(ntsp,sizeof(int));         pafirst = phead;         pasecond = phead;         input();         calculate();          output();         Save();     }             

    标签: 源代码

    上传时间: 2016-12-28

    上传用户:150501

  • 重力异常正演MATLAB程序

    %球体 close all; G=6.67e-11; R=2;%球体半径 p=4.0;%密度 D=10.0;%深度 M=(4/3)*pi*R^3*p;%质量 x=-20:1:20; g=G*M*D./((x.^2+D^2).^(3/2)); Vxz=-3*G*M*D.*x./((x.^2+D^2).^(5/2)); Vzz=G*M.*(2*D^2-x.^2)./((x.^2+D^2).^(5/2)); Vzzz=3*G*M.*(2*D^2-3.*x.^2)./((x.^2+D^2).^(7/2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('球体重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %水平圆柱体 close all G=6.67e-11; p=10.0;%线密度 D=100.0;%深度 x=-200:1:200; g=G*2*p*D./(x.^2+D^2); Vxz=4*G*p*D.*x./(x.^2+D^2).^2; Vzz=2*G*p.*(D^2-x.^2)./(x.^2+D^2).^2; Vzzz=4*G*p.*(D^2-3.*x.^2)./((x.^2+D^2).^3); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('水平圆柱体重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %垂直台阶 G=6.67e-11; p=4.0;%密度 h1=50.0;%下层深度 h2=40.0;%上层深度 x=-100:1:100; g=G*p.*(pi*(h1-h2)+x.*log((x.^2+h1^2)./(x.^2+h2^2))+2*h1.*atan(x./h1)-2*h2.*atan(x./h2)); Vxz=G*p.*log((h1^2+x.^2)./(h2^2+x.^2)); Vzz=2*G*p.*atan((x.*(h1-h2))./(x.^2+h1*h2)); Vzzz=2*G*p.*x*(h1^2-h2^2)./((h1^2+x.^2).*(x.^2+h2^2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('垂直台阶重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %倾斜台阶 G=6.67e-11; p=4.0;%密度 h1=50.0;%下层深度 h2=40.0;%上层深度 a=pi/6;%倾斜角度 x=-500:1:500; g=G*p.*(pi*(h1-h2)+2*h1.*atan((x+h1*cot(a))./h1)-2*h2.*atan((x+h2*cot(a))./h1)+x.*sin(a)^2.*log(((h1+x.*sin(a).*cos(a)).^2+x.^2.*sin(a)^4)./((h2+x.*(sin(a)*cos(a))).^2+x.^2.*sin(a)^4))); Vxz=G*p.*(sin(a)^2.*log(((h1*cot(a)+x).^2+h1^2)./((h2*cot(a)+x).^2+h2^2))-2*sin(2*a).*(atan((h1/sin(a)+x.*cos(a))./(x.*sin(a)))-atan((h2/sin(a)+x.^cos(a))./(sin(a).*x)))); Vzz=G*p.*(0.5*sin(2*a)^2.*log(((h1*cot(a)+x).^2+h1^2)./((h2*cot(a)+x).^2+h2^2))+2*sin(a)^2.*(atan((h1/sin(a)+x.*cos(a))./(x.*sin(a)))-atan((h2/sin(a)+x.*cos(a))./(x.*sin(a))))); Vzzz=2*G*p*sin(a)^2.*((x+2*h2*cot(a))./((h2*cot(a)+x).^2+h2^2)-(x+2*h1*cot(a))./((h1*cot(a)+x).^2+h1^2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离(m)'); ylabel('重力异常值'); title('倾斜台阶重力异常Δg'); grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on %% %铅锤柱体 G=6.67e-11; p=4.0;%密度 h1=50.0;%下层深度 h2=40.0;%上层深度 a=3;%半径 x=-500:1:500; g=G*p.*((x+a).*log(((x+a).^2+h1^2)./((x+a).^2+h2^2))-(x-a).*log(((x-a).^2+h1^2)./((x-a).^2+h2^2))+2*h1.*(atan((x+a)./h1)-atan((x-a)./h1))-2*h2.*(atan((x+a)./h2)-atan((x-a)./h2))); Vxz=G*p.*log((((x+a).^2+h1^2).*((x-a).^2+h2^2))./(((x+a).^2+h2^2).*((x-a).^2+h1^2))); Vzz=2*G*p.*(atan(h1./(x+a))-atan(h2./(x+a))-atan(h1./(x-a))+atan(h2./(x-a))); Vzzz=2*G*p.*((x+a)./((x+a).^2+h2^2)-(x+a)./((x+a).^2+h1^2)-(x-a)./((x-a).^2+h2^2)+(x-a)./((x-a).^2+h1^2)); subplot(2,2,1) plot(x,g,'k-'); xlabel('水平距离/m') ylabel('重力异常值') title('铅垂柱体重力异常') grid on subplot(2,2,2) plot(x,Vxz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vxz'); grid on subplot(2,2,3) plot(x,Vzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzz'); grid on subplot(2,2,4); plot(x,Vzzz); xlabel('水平距离(m)'); ylabel('导数值'); title('Vzzz'); grid on

    标签: MATLAB 重力 程序

    上传时间: 2019-05-10

    上传用户:xiajiang

  • 基于AVR单片机的程控可编程线性电源设计

    程控可编程线性电源广泛应用于集成电路测试和各种实验过程中,电源的性能、可靠性和易操作性是其关键指标。本文以ATmega128单片机为控制核心,以ADS8341模数转换器、 AD5624数模转换器,设计了一款三通道输出的程控可编程线性电源样机。阐述该电源的系统架构、结构、操作系统、液晶显示界面以及通信协议等设计内容。对样机进行了测试,给出了该电源的常用指标,该样机已长时间应用于高速高精度A/D转换器和D/A转换器的测试中。

    标签: avr 单片机 可编程线性电源

    上传时间: 2022-03-28

    上传用户:canderile

  • A) 实现虚拟存储B) 实现对文件的按名存取C) 实现对文件的按内容存取D) 实现对文件的 高速输入输出(17) 分页显示当前文件 ... A) 执行SPLIB B) 执行SPDOS C) 装载拼音模

    A) 实现虚拟存储B) 实现对文件的按名存取C) 实现对文件的按内容存取D) 实现对文件的 高速输入输出(17) 分页显示当前文件 ... A) 执行SPLIB B) 执行SPDOS C) 装载拼音模块D) 装载五笔字型输入模块(32) 在汉字输入状态下,按下Shift+a组合键后,输入了__。

    标签: SPLIB SPDOS 存取 17

    上传时间: 2013-12-23

    上传用户:zhoujunzhen

  • A.执行SPLIB B.执行SPDOS C.装载拼音模块D.装载五笔字型输入模块32.在汉字输入状态下

    A.执行SPLIB B.执行SPDOS C.装载拼音模块D.装载五笔字型输入模块32.在汉字输入状态下, 按下Shift+A组合键后,输入了_______。 ... A.按原代码方式B.按指定字体C.按标准方式D. 按分栏方式41.FoxBASE启动后,在圆点"."提示符下,执行命令文件MAIN.

    标签: A. B. C. D.

    上传时间: 2015-04-02

    上传用户:极客

  • 将A、B、C、D、E、F这六个变量排成如图所示的三角形

    将A、B、C、D、E、F这六个变量排成如图所示的三角形,这六个变量分别取[1,6]上的整数,且均不相同。求使三角形三条边上的变量之和相等的全部解。如图就是一个解。

    标签: 变量 三角形

    上传时间: 2013-12-16

    上传用户:GHF

  • 学生成绩管理系统功能简介 a. 查询指定学号学生成绩记录。 b. 按平均分顺序插入一个新的学生成绩。 c. 删除指定学号学生记录。 d. 修改指定学号学生成绩记录。 e. 在屏幕上输出所

    学生成绩管理系统功能简介 a. 查询指定学号学生成绩记录。 b. 按平均分顺序插入一个新的学生成绩。 c. 删除指定学号学生记录。 d. 修改指定学号学生成绩记录。 e. 在屏幕上输出所有学生的成绩。 f. 将学生成绩输出到文件。

    标签: a. b. c. d.

    上传时间: 2015-06-06

    上传用户:叶山豪

  • 介绍一个基于U S B 2 . 0 接口和D S P 的高速数据采集处理系统的工作原理设计及实现该高速数据 采集处理系统采用TI 公司的TMS320C6000 数字信号处理器和Cypress 公司的

    介绍一个基于U S B 2 . 0 接口和D S P 的高速数据采集处理系统的工作原理设计及实现该高速数据 采集处理系统采用TI 公司的TMS320C6000 数字信号处理器和Cypress 公司的USB2.0 接口芯片可 以实现高速采集和实时处理有着广泛的应用前景

    标签: Cypress C6000 320C 6000

    上传时间: 2013-11-27

    上传用户:koulian

  • 四选一选择器,输入四个,输出1个.当NM=00时选A 当NM=01时选B 当NM=10时选C 当NM=11时选D

    四选一选择器,输入四个,输出1个.当NM=00时选A 当NM=01时选B 当NM=10时选C 当NM=11时选D

    标签: NM 00 01 10

    上传时间: 2013-12-25

    上传用户:woshiayin