用MATLAB编写的一个猜数字游戏 就是随机生成4位数,你要在有限的步数内猜出。 用法:输入4位数字后按’ok’键,可看到当前结果。 按answer键查看正确答案 按reset键重新开始 还有很多不成熟的地方,发上来想和大家一起商量商量 主要问题: 1、步数限制功能没有完成 2、应当在显示区保留显示以前的所有步骤,但目前只能显示当前步骤 3、按键次数没有保留,无法判断你已经猜了几次 一个小bug:若输入3位数,则会自动把第一位置0
上传时间: 2014-01-13
上传用户:王者A
This is svd source code implementation in c++ , the zip file contain the ap file ,more detail ,please see the ap library adapted for c++ in the zip file.also there is faq to answer your question.
标签: file implementation the contain
上传时间: 2013-12-27
上传用户:aappkkee
#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
A major societal challenge for the decades to come will be the delivery of effective medical services while at the same time curbing the growing cost of healthcare. It is expected that new concepts-particularly electronically assisted healthcare will provide an answer. This will include new devices, new medical services as well as networking. On the device side, impressive innovation has been made possible by micro- and nanoelectronics or CMOS Integrated Circuits. Even higher accuracy and smaller form factor combined with reduced cost and increased convenience of use are enabled by incorporation of CMOS IC design in the realization of biomedical systems. The compact hearing aid devices and current pacemakers are good examples of how CMOS ICs bring about these new functionalities and services in the medical field. Apart from these existing applications, many researchers are trying to develop new bio-medical solutions such as Artificial Retina, Deep Brain Stimulation, and Wearable Healthcare Systems. These are possible by combining the recent advances of bio-medical technology with low power CMOS IC technology.
上传时间: 2017-02-06
上传用户:linyj
Many times I have been asked to explain “ briefl y ” how SDH, SONET, and the OTN “ exactly ” work. The questions came mainly from new colleagues, stu- dents, and users of these technologies, personally or via the usenet newsgroup comp.dcom.sdh - sonet. I could have referred them to the standards documents, but to provide a more consistent and clear answer I decided to write this pocket guide. The objective of this book is that it can be used both as an introduction as well as a reference guide to these technologies and their spe- cifi c standards documents.
标签: Generation Transport Optical ComSoc Guide
上传时间: 2020-05-27
上传用户:shancjb
There are few technologies that have had a more profound effect on people’s lives than mobile communications. As recently as twenty years ago no one had a mobile phone, while today 1.4 billion men, women and children depend on them. This now exceeds the number of landline users, where it took the preceding one hundred years to reach the 1 billion mark. The ability to make mobile voice calls turns out to be the answer to a deeply felt need across different cultures who simply want to communicate.
标签: Communications Wireless Mobile and
上传时间: 2020-05-30
上传用户:shancjb
This effort started as an answer to the numerous questions the authors have repeatedly had to answer about electrostatic discharge (ESD) protection and input/output (1/0) designs. In the past no comprehensive book existed suffi- ciently covering these areas, and these topics were rarely taught in engineering schools. Thus first-time I/O and ESD protection designers have had consider- able trouble getting started. This book is in part an answer to such needs.
上传时间: 2020-06-05
上传用户:shancjb
I would like to thank you for purchasing the second edition of “Industrial Network Security,” especially if you are one of the many supporters of the first edition. When the second edition was announced, many people asked me, “why a second edition?” and even more followed that up with, “and why a coauthor?” These ques- tions are harder to answer than you would think.
标签: Industrial Security Network
上传时间: 2020-06-07
上传用户:shancjb
We are in the era of ubiquitous computing in which the use and development of Radio Frequency Iden- tification (RFID) is becoming more widespread. RFID systems have three main components: readers, tags, and database. An RFID tag is composed of a small microchip, limited logical functionality, and an antenna. Most common tags are passive and harvest energy from a nearby RFID reader. This energy is used both to energize the chip and send the answer back to the reader request. The tag provides a unique identifier (or an anonymized version of that), which allows the unequivocal identification of the tag holder (i.e. person, animal, or items).
上传时间: 2020-06-08
上传用户:shancjb
抢答器是一种智力竞赛常用的器件,抢答器的设计方法千差万别,文章利用常用的数字电子器件,设计了八路抢答器电路的设计、仿真及实现的全过程,提出两种可行的设计方案:方案1采用74ls373实现电路锁存,74ls148实现电路编码,74ls74及数码管实现电路显示;方案二采用CD4511BCN和LMC555CM集成电路及数码管实现抢答器的控制和显示。本文设计用的器件简单,容易理解,适用于初学电子技术的人员。answer scrambler is a common device in intelligence competition, and its design methods vary greatly. This paper designs the whole process of design, simulation and Realization of the circuit of eight-way answer scrambler by using common digital electronic devices, and puts forward two feasible design schemes: scheme 1 uses 74 ls373 to realize circuit latching, 74 ls148 to realize circuit coding,74 ls74 and digital tube to realize circuit. The second scheme uses CD4511 BCN, LMC555 CM integrated circuit and digital tube to control and display the answerer. The device designed in this paper is simple and easy to understand, and it is suitable for the beginners of electronic technology.
标签: 抢答器
上传时间: 2022-04-05
上传用户: