rpct.net
当前位置:首页 >> 求C语言程序设计 5个小程序 ,共300行代码 >>

求C语言程序设计 5个小程序 ,共300行代码

贪吃蛇游戏#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

300行还简单啊,呵呵,你自己去C语言代码库找找啊,应该有你想要的 #include <stdio.h>#include <stdlib.h>#include <string.h> struct STU { long Num; int mathScore; int englishScore; int computerScore; int allScore; int averageScore; }; void sort(

第一个#include<stdio.h>int main(){ int a,he,i,s; for(he=0,i=0,s=0;i<9;i++) { scanf("%d",&a); he+=a; if(a>=60)s++; } printf("%d %d",he,s); return 0;}

#include #include using namespace std;//const variablesconst int BOARD_HEIGHT=15; //height of a boardconst int BOARD_WIDTH=35; //width of a boardconst char

使用printf画一幅画吧 大一点

留下邮箱,我发给你

#include "stdio.h" int main(int argv,char *argc[]){ char x[20]="你好"; printf("请输入汉字姓名:"); scanf("%s",x+4); printf("\n%s\n\n",x); return 0; }运行样例:

#include int main() { float a,b; char c,i='a'; for(;i!='0';) { printf("请输入要运算的表达式:"); scanf("%f%c%f",&a,&c,&b); switch(c) { case '+':printf("运算的结果是:%f\n",a+b);break; case '-':printf("运算的结果是:%f\n",a-b);break;

第一题: #include "stdio.h" main() { int a,b,c,k; printf("请键入3个整数:"); scanf("%d%d%d",&a,&b,&c); if(a>b){k=a;a=b;b=k;} if(a>c){k=a;a=c;c=k;} if(b>c){k=b;b=c;c=k;} printf("调整后的a,b,c分别为:%d,%d,%d\n",a,b,c); }

#include<stdio.h> int main() { float hour; printf("How many hours did you excise?\nPlease input it ^_^ :"); scanf("%f",&hour); //输入函数中“”内不能加\n; bool a,b; a=hour>=0.5; b=hour<=1; if(a&&b)//判断时候,因为a和b本身就是Bool型,直

网站首页 | 网站地图
All rights reserved Powered by www.rpct.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com