ITfeng

 

2012年4月26日

带头结点链表逆序实现

摘要: #include<stdlib.h>#include<stdio.h>typedef struct list{int data;struct list*next;} List;List* insert_list_last();List*reverse(List*head);int main(){List*head;List*p;head=insert_list_last();p=head->next;while(p){printf("%d\n",p->data);p=p->next;}printf("affter reve 阅读全文

posted @ 2012-04-26 22:16 ITfeng 阅读(383) 评论(0) 推荐(0) 编辑

大数相乘问题--解决方案

摘要: #include<stdio.h>#include<stdlib.h>#include<string.h>void mutiply(char*a,char*b,char*res){int len1,len2,len;char temp;int*result;int i=0,j;int startFlag=0;len1=strlen(a);len2=strlen(b);len=len1+len2+1;result=(int *)malloc(len*4);for(i=0;i<len;i++)result[i]=0;for(i=0;i<len1/2; 阅读全文

posted @ 2012-04-26 21:18 ITfeng 阅读(236) 评论(0) 推荐(0) 编辑

导航