|
|
|
|
|
|
11 2017 档案
计数器 中断
摘要:#include #define uint unsigned int #define uchar unsigned char sbit lw=P3^1; sbit ld=P3^0; uchar duan[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; uchar wei[]={0x01,0x02,0x04,0x08,0...
阅读全文
计算利润
摘要:/* Note:Your choice is C IDE */ #include "stdio.h" void main() { //定义变量 long int i; double bonus1,bonus2,bonus4,bonus6,bonus10,bonus; //输入利润数 printf("请输入利润数"); scanf("%1d",&i); ...
阅读全文
外部中断0,1
摘要:#include #define uint unsigned int #define uchar unsigned char uchar duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uchar liushui[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; ucha...
阅读全文
矩形按键
摘要:1 #include 2 #define uint unsigned int 3 #define uchar unsigned char 4 uchar keynum=0; 5 uchar duan[]={0xc0,~0x06,~0x5b,~0x4f,~0x66,~0x6d,~0x7d,~0x07,~0x7f,~0x6f,~0x77,~0x7c,~0x39,~0x...
阅读全文
倒数100
摘要:#include #define uint unsigned int #define uchar unsigned char uchar duan[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; sbit w1=P2^0; sbit w2=P2^1; uint num=0; void delay(uint n) { whil...
阅读全文
空矩形星星排列图源程序
摘要:/* Note:Your choice is C IDE */ #include "stdio.h" void main() { int row,col,r,c; printf("请输入行数"); scanf("%d",&row); printf("请输入列数"); scanf("%d",&col); for(r=1;r1&&r1&&c<col) printf("...
阅读全文
点名源程序
摘要:/* Note:Your choice is C IDE */ #include "stdio.h" #include "stdlib.h" #include "time.h" void main() { int i,j; char name; srand((unsigned)time(NULL)); for(j=1;j<=10;j++) { ...
阅读全文
计数器
摘要:#include #define uint unsigned int #define uchar unsigned char uchar duan[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x83,0xc6,0xa1,0x86,0x8e,0x71,0x0e,0x0c,0x0b,0x07}; // ...
阅读全文
按键
摘要:#include #define uint unsigned int #define uchar unsigned char sbit k1=P3^2; sbit k2=P3^3; uchar duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};//阴极管的代码 数组 char num=0;//定义一个数调用数组的...
阅读全文
游戏石头剪刀布
摘要:/* Note:Your choice is C IDE */ #include "stdio.h" #include "stdlib.h"//srand rand调用的头文件 #include "time.h"// void main() { int ren;//定一个人输入的拳种 int i; //用于for循环的条件 int x; //开关语句 int jq; // ...
阅读全文
继电器
摘要:#include <reg52.h> #define uint unsigned int #define uchar undingned char sbit relay=P2^7; void delayn50ms(uint n) { uint i,j; for(i=0;i<n;i++) for(j=
阅读全文
分解质因数
摘要:#include "stdio.h" void main() { int a,b=2,c=0,d; printf("请输入一个数:"); xx: c=scanf("%d",&a); if(c!=1||a=b;) { if(a%b==0) { if(a!=b) printf(...
阅读全文
斐波那契数列
摘要:#include "stdio.h" void main() { int a,b,c,i; a=b=1; printf("%d\n %d\n",a,b); for(i=1;i<=13;i++) { c=a+b; printf("%d\n",c); a=b; b=c; } }
阅读全文
猜字游戏
摘要:1 /* Note:Your choice is C IDE */ 2 #include "stdio.h" 3 #include 4 #include 5 void main() 6 { 7 int i,j; 8 srand((unsigned)time(NULL));//生成不重复的随机数stdlib.h 9 j=rand() %100;// 10 ...
阅读全文
求园的周长、面积、直径
摘要:1 #include "stdio.h" 2 void main() 3 { 4 float PI,r,C,S,d; 5 PI=3.14f;/*将3.14存入到PI所分配的内存空间中*/ 6 7 printf("请输入一个圆的半径:"); 8 scanf("%f",&r);/*将键盘输入的数据存入到
阅读全文
|
|