约瑟夫循环

#include<stdio.h>#include<stdlib.h>typedef struct N{ int i; struct N* next;}List;int main(void){ List *L,*H,*P,*Q; L=(List *)malloc(sizeof(List)); L->i=1; L->next=NULL; H=L; P=L; int j; int n=0; int k=0; for(j=2;j<=30;j++){ Q=(List *)malloc(sizeof(List))...
默认分类 | 2012-05-10 22:58 | 阅读 962 次 | 评论 0 条

#include<stdio.h>#include<stdlib.h>#define MaxSize 100#define ApplySpaceFail -1#define TRUE 1#define FALSE 0#define UNLIMIT 65535#define Edges 15int visited[MaxSize];int P[MaxSize];int D[MaxSize];int PF[MaxSize][MaxSize];int DF[MaxSize][MaxSize];typedef struct Graph{ char vex[MaxSize]; ...
默认分类 | 2012-02-29 23:18 | 阅读 741 次 | 评论 0 条

Key_ scan(void)

//-------------------------------------------//头文件//-------------------------------------------#include<reg51.h>#include<stdio.h>typedef unsigned char uchar;typedef unsigned char uint;uchar counter=0;sbit key1=P3^2;sbit key2=P3^3;sbit key3=P3^4;sbit key4=P3^5;//---------------------------...
默认分类 | 2011-03-10 12:39 | 阅读 2746 次 | 评论 1 条

C 51

好久没发代码了,最近在学单片机,就写了一些简单的东西,高手见笑了! #include<reg52.h>#include<stdio.h>unsigned int i=0;typedef unsigned char unchar;unchar Ledinit=0xE7;unchar LedshiftL=0xDF;unchar LedshiftR=0xFB;unchar r=0x01;unchar l=0x80; unchar counter=0;void Init_timer(void){ TMOD=0x22; TH0=TL0=56; TR0=1; ...
默认分类 | 2011-03-04 23:04 | 阅读 884 次 | 评论 0 条

THE GETTYSBURGER ADDRESS

Four score and seven years ago our fathers brought forth on this continient a new nation conceived in leberty and dedicated to the propersition that all men are created equal. Now we are engaged in agreat civil war ,testing wheather that nation or any nation so conceived ...
默认分类 | 2010-06-04 17:26 | 阅读 768 次 | 评论 0 条

a粒子散射实验模拟

#include<stdio.h>#include<graphics.h>#include<dos.h>#include<math.h>#include<conio.h>#include<stdlib.h>#include<time.h>#define PI 3.1415926 #define angle1 3.1415926/5#define angle2 3.1415926/10#define angle3 3.1415926/180 extern int s=9; void output_result(int n1,int n2,int n3,int n4,int n5,in...
默认分类 | 2010-06-03 19:02 | 阅读 704 次 | 评论 0 条

物理情景模拟

#include<stdio.h>#include<graphics.h>#include<math.h>#include<stdlib.h>#include<dos.h>#include<conio.h>#include<time.h> #define PI 3.1415926 void output_text() /*输出文本*/ { outtextxy(120,200,"Dear friends:"); outtextxy(120,215," Do you know ,everything in the space i...
默认分类 | 2010-05-08 14:58 | 阅读 620 次 | 评论 0 条
文章分类
最新评论