- 博客(5)
- 收藏
- 关注
原创 在长字符串中找单词并显示位置。
#include int find(const char *str1,const char *str2,int *pos); int main() { char *str1="helhellhellohello"; char *str2="hello";
2011-10-13 10:36:46
615
原创 大整数的乘法问题
如果两个很大的整数相乘,结果无法以简单的数据类型存储,可以假设将每位分开存储到数组里面,本例暂不考虑数字存放时的空间优化问题。 #include #include #include using namespace std; void multi(int *a,int a
2011-10-12 15:56:53
394
原创 链表的操作
/* 结点0为头结点,不保存有意义的数据;从结点1开始保存有意义的数据 */ #include #include #include typedef struct node { int data; struct node *next; }NODE,* PNODE; PN
2011-09-13 21:34:37
281
原创 汉诺塔C语言实现
/* 汉诺塔的例程,利用递归,将N个盘子从a借助b移动到c 运行时,a为原始柱子,b为空柱子,c为目标柱子 编号 1~n 对应的从盘子小到大 */ #include void move(int n,char a,char b,char c); int main() {
2011-09-13 11:50:19
1151
原创 1.9.编写程序,将输入复制到输出,并且将连续的多个空格用一个替换。
#include int main() { int c,i; i=0; while((c=getchar())!=EOF){ if(c==' '){ i++; putchar(' '); if(i>1) putchar('\b'); } else{
2011-08-22 20:01:13
444
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅