c语言课程设计题目C语言大一课程设计,我们期末考试的作业,大家给个代码啊,要求简单的动画或小游戏,谢谢

c语言课程设计题目  时间:2021-06-03  阅读:()

C语言..课程设计参考题目

#include<stdio.h> #include<conio.h> #include<math.h> #include<stdlib.h> #define UNKNOWN_CHAR 2 #define DIVISOR_IS_ZERO 3 #define FALSE 0 #define TRUE 1 typedef struct string {char str; struct string *next; }string; char *GetString(); double GetASResultOf(char * str, int *rank, int *errorNum); double GetUnitageOf(char * str, int *rank, int *errorNum); int main() { double value; int rank=0; int errorNum=TRUE; char * str; printf("Please input your arithmetic: "); str=GetString(); value = GetASResultOf(str, &rank, &errorNum); if (errorNum==TRUE) printf("The result is: %lf ",value, rank); else if (errorNum==UNKNOWN_CHAR) printf("char error! "); else if (errorNum==DIVISOR_IS_ZERO) printf("Divisor could not be 0 "); else printf("Other error "); getch(); return 0; } char *GetString() { char *CharToString(string * sHead, int arraySize); int arraySize=0; string *s; string *sHead; s = (string *)malloc(sizeof(string)); sHead = s; s->str = getchar(); arraySize++; while((s->str)!=' ') { arraySize++; s->next=(string *)malloc(sizeof(string)); s=s->next; s->str=getchar(); } return CharToString(sHead, arraySize); } char *CharToString(string * sHead, int arraySize) { char *strArray; string *s=sHead; int i=0; strArray = (char*)malloc(arraySize*sizeof(char)); while(i<arraySize) { if (s->str=='=' || s->str==' ') break; if (s->str!=32) strArray[i++]=s->str; s=s->next; } strArray[i]=''; return strArray; }

C语言课程设计

#include"stdio.h"#include "stdlib.h" #define SIZE 10 struct chenji {puter; float program; float math; float english; float PE; }; struct student {char num[12]; char name[20]; char sex[2]; int age; struct chenji score; }std1[SIZE],std2[SIZE]; inputdata() {int i; printf("Number name sex(M/F) puter Program Math English PE "); for(i=0;i<SIZE;i++) scanf("%s%s%s%d%f%f%f%f%f ",std1.num,std1.name,std1.sex,std1.age,puter,std1.score.program,std1.score.math,std1.score.english,std1.score.PE); } datawrite() {FILE *fp; /*学生成绩管理系统,c语言课程设计*/int i; fp=fopen("STD.DAT","wb");if(fp==NULL) {printf("can not open the file "); exit(0); } for(i=0;i<SIZE;i++) {fwrite(std1,sizeof(struct student),1,fp); } fclose(fp); }

C语言大一课程设计,我们期末考试的作业,大家给个代码啊,要求简单的动画或小游戏,谢谢

我给你个游戏,是贪吃蛇的 #define N 200 #include <graphics.h> #include <stdlib.h> #include <dos.h> #define LEFT 0x4b00 #define RIGHT 0x4d00 #define DOWN 0x5000 #define UP 0x4800 #define ESC 0x011b int i,key; int score=0;/*得分*/ int gamespeed=50000;/*游戏速度自己调整*/ struct Food { int x;/*食物的横坐标*/ int y;/*食物的纵坐标*/ int yes;/*判断是否要出现食物的变量*/ }food;/*食物的结构体*/ struct Snake { int x[N]; int y[N]; int node;/*蛇的节数*/ int direction;/*蛇移动方向*/ int life;/* 蛇的生命,0活着,1死亡*/ }snake; void Init(void);/*图形驱动*/ void Close(void);/*图形结束*/ void DrawK(void);/*开始画面*/ void GameOver(void);/*结束游戏*/ void GamePlay(void);/*玩游戏具体过程*/ void PrScore(void);/*输出成绩*/ /*主函数*/ void main(void) { Init();/*图形驱动*/ DrawK();/*开始画面*/ GamePlay();/*玩游戏具体过程*/ Close();/*图形结束*/ } /*图形驱动*/ void Init(void) { int gd=DETECT,gm; initgraph(&gd,&gm,"c:\tc"); cleardevice(); } /*开始画面,左上角坐标为(50,40),右下角坐标为(610,460)的围墙*/ void DrawK(void) { /*setbkcolor(LIGHTGREEN);*/ setcolor(11); setlinestyle(SOLID_LINE,0,THICK_WIDTH);/*设置线型*/ for(i=50;i<=600;i+=10)/*画围墙*/ { rectangle(i,40,i+10,49); /*上边*/ rectangle(i,451,i+10,460);/*下边*/ } for(i=40;i<=450;i+=10) { rectangle(50,i,59,i+10); /*左边*/ rectangle(601,i,610,i+10);/*右边*/ } }

  • c语言课程设计题目C语言大一课程设计,我们期末考试的作业,大家给个代码啊,要求简单的动画或小游戏,谢谢相关文档

webhosting24:€28/年,日本NVMe3900X+Webvps

webhosting24决定从7月1日开始对日本机房的VPS进行NVMe和流量大升级,几乎是翻倍了硬盘和流量,当然前提是价格依旧不变。目前来看,国内过去走的是NTT直连,服务器托管机房应该是CDN77*(也就是datapacket.com),加上高性能平台(AMD Ryzen 9 3900X+NVMe),这样的日本VPS还是有相当大的性价比的。官方网站:https://www.webhosting...

AkkoCloud(60元/月 ),英国伦敦CN2 1核 768 MB 内存 10 GB SSD 硬盘 600GB 流量 英国伦敦CN2 1核  1.5G  300Mbps

官方网站:https://www.akkocloud.com/AkkoCloud新品英国伦敦CN2 GIA已上线三网回程CN2 GIA 国内速度优秀.电信去程CN2 GIALooking Glass:http://lonlg.akkocloud.com/Speedtest:http://lonlg.akkocloud.com/speedtest/新品上线刚好碰上国庆节 特此放上国庆专属九折循环优惠...

TTcloud:日本独立服务器促销活动,价格$70/月起,季付送10Mbps带宽

ttcloud怎么样?ttcloud是一家海外服务器厂商,运营服务器已经有10年时间,公司注册地址在香港地区,业务范围包括服务器托管,机柜托管,独立服务器等在内的多种服务。我们后台工单支持英文和中文服务。TTcloud最近推出了新上架的日本独立服务器促销活动,价格 $70/月起,季付送10Mbps带宽。也可以跟进客户的需求进行各种DIY定制。点击进入:ttcloud官方网站地址TTcloud拥有自...

c语言课程设计题目为你推荐
自动识别查询快递单号查看单号怎么知道是那个快递公司的腾讯年终奖腾讯工作怎么样模式识别算法模式识别的简史部署工具win10 评估和部署工具包有什么用遗传算法实例求助fortran语言编写的混合遗传算法例子那位大哥大姐有?assemblyinfocsgo很跟cs有什么区别labelforandroid:labelfor是什么意思文本框透明word里文本框怎么透明?kjavaJava与KJava有什么区别吗.?人脸识别解锁iphone人脸识别解锁
移动服务器租用 租服务器价格 广东vps 已备案域名出售 阿里云搜索 buyvm enzu 主机点评 blackfriday linode 国内永久免费云服务器 vmsnap3 ixwebhosting 国内加速器 mysql主机 网盘申请 绍兴高防 天互数据 我爱水煮鱼 怎么建立邮箱 更多