自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

靖 的算法花园

******************************************算法才是程序的灵魂*******************************************

  • 博客(15)
  • 收藏
  • 关注

原创 雷劈数,奇怪的数字

 main(){ long i=1000; long c,d,e,f; long max, chu; max=10000; chu=100;    while(i {  for(;i  {   c=i/chu;      d=i%chu;      e=c+d;      f=e*e;      if(i==f)      printf("%ld  ",i );  }  i*=10;  max*=

2007-08-01 13:30:00 1873

原创 无聊一下.

#include#includemain(){  int i;  textmode(C80);  textbackground(0);  clrscr();     window(10,5,30,15);     textbackground(5);     clrscr();     textcolor(7);     highvideo();     cputs("my nam

2007-06-13 21:57:00 472

原创 十进制数到二进制数的转换,(随手写的,稍微麻烦一点,)

#define null 0typedef struct node{int data;struct node *next;}node;main(){node *pointer,*pointer2;int num;pointer=(node*)malloc(sizeof(node));pointer->next=null;scanf("%d",&num);printf("/nshi jin

2007-05-23 23:54:00 599

原创 对栈段的理解(用数组描述)

 #define STACK_INIT_SIZE 10#define STACKINCREMENT 2typedef struct{ int *base; int *top; int stacksize;}SqStack;main(){ SqStack s; int i; int *newbase; int e=0;    /*SET STACK STACT*/ s.base=(int

2007-05-12 23:30:00 598

原创 深入理解静态链表(,物理上是一个结构体数组,逻辑上是两个链表,)执行一下,,,

 #include "stdio.h"#define MAXSIZE 10typedef struct{ int data; int cur;}component,slinklist[MAXSIZE];main(){int mallocsl(slinklist); slinklist link; int i,head,p; int num_a; for(i=0;i  link[i].cur=i

2007-05-11 12:31:00 858

原创 把字符串小写化 算法2

/*把字符串小写化**算法2*/ main(){ int i; char *c="JingBaoHua"; for(i=0;c[i]!=/0;++i)    c[i]=c[i] | 32;/*按位或*/   printf("%s/n",c);}

2007-05-08 23:10:00 604

原创 把字符串中全部小写化 算法1

/*把字符串中全部小写化*算法1:*/main(){ int i; char *c="JingBaoHua"; for(i=0;c[i]!=/0;++i)  c[i]=(c[i]=A)? (c[i]+32): c[i];   printf("%s/n",c);} 

2007-05-08 23:04:00 692 1

原创 判断二进制位上1个数量

main(){ unsigned x; int a,num; printf("put in a number:/n"); scanf("%u",&x);/*方法1:*/ for(num=0,a=1;a!=0;a  if(a&x) ++num; printf("/nthe number of 1 is :%d/n",num);/*方法二: */ for(num=0,a=1;x!=

2007-05-08 22:47:00 586

原创 dos中copy命令的C语言实现。。。。

 # include main(int argc,char *argv[]){ FILE *in,*out; char ch; /*,infile[10],outfile[10]*/ /* printf("enter the infile name:/n"); scanf("%s",infile); printf("enter the outfile name:/n"); scanf("%s"

2007-04-16 13:16:00 1785

原创 链表的综合操作(重新整理,模块一点)

#define NULL 0#define LEN sizeof(struct student)struct student{ long num; long score; struct student *next;};  int j,listnum,delnum,n; int num1=1000,score1=2000; struct student *head,*p1,*p2; /*输出链表*/

2007-04-15 12:00:00 709

原创 l链表的综合操作

#define NULL 0#define LEN sizeof(struct student)struct student{ long num; long score; struct student *next;};main(){ int j,listnum,delnum,n; int num1=1000,score1=2000; struct student *head,*p1,*p2; 

2007-04-15 11:45:00 639

原创 利用“指针”对主调函数中数组进行排序,(菜鸟知道模块化)

void paixu(int *arr,int n){ int temp; int i,j; for(i=0;i   for(j=i+1;j   if(*(arr+i)    {     temp=*(arr+i);     *(arr+i)=*(arr+j);     *(arr+j)=temp;     }}main(){ int a[10]; int i,*p; for(p=

2007-03-29 12:10:00 801

原创 比较法排序 (3.29修改,无错)

/***********************   比较法排序     **** author:lunasjing ****  date:2007.3.28  ***********************/#includemain(){ int j,i,temp; /*定义数组长度为6,下标从0开始,到5结束*/ int a[6];   /*为了保险,先把它们初始化*/           j

2007-03-28 21:44:00 1034

原创 冒泡法排序(3.29修改,无错)

/*************************   /***********************    冒泡法排序    **** author:lunasjing ****  date:2007.3.28  ***********************/#includemain(){int j,i,temp;int a[6]; j=i=temp=0;  /*初始化数组,在数组中输入等

2007-03-28 21:43:00 688

原创 开业大吉

 开业大吉点燃鞭炮。劈哩啪啦。。。

2007-03-28 21:30:00 505 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除