
C语言
衢州小伙
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
二叉堆
#include #include int lowbit(int x) { int z; z = ~x; z++; return (x & z); } //测试 /*int main(void) { int n,t; n = 50; while(n) { t = lowbit(n); printf("%d\n",t); n -= t; } return 0; }原创 2015-07-09 22:25:05 · 1202 阅读 · 0 评论 -
左偏树
#include #include typedef struct node { int key,dist; struct node *Left,*Right; }LeftistTree; void Swap(LeftistTree** a,LeftistTree** b) { LeftistTree *tmp; tmp = *a; *a = *b; *b = tmp; } Leftis原创 2015-07-10 00:19:48 · 779 阅读 · 0 评论 -
整数溢出
#include int main(void) { int i,a = 1; long int b = 1; unsigned int c = 1; short d = 1; for(i = 1;i <= 31;i ++) { a *= 2; } a = a - 1; printf("a = %d\n",a); a += 1; printf("a = %d\n",a)原创 2015-07-03 19:47:51 · 543 阅读 · 0 评论 -
HDU 2032 杨辉三角
杨辉三角 Problem Description 还记得中学时候学过的杨辉三角吗?具体的定义这里不再描述,你可以参考以下的图形: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 Input 输入数据包含多个测试实例,每个测试实例的输入只包含一个正整数n(1 Output 对应原创 2015-07-05 16:26:36 · 831 阅读 · 0 评论 -
HDU 2028 Lowest Common Multiple Plus
Lowest Common Multiple Plus Problem Description 求n个数的最小公倍数。 Input 输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数。 Output 为每组测试数据输出它们的最小公倍数,每个测试实例的输出占一行。你可以假设最后的输出是一个32位的整数。原创 2015-07-05 14:34:20 · 719 阅读 · 0 评论 -
C语言 非打印字符
#include int main(void) { char ch; ch = 7; int count = 20; /*printf("%c",ch); printf("\007"); printf("\a"); printf("\7"); printf("\x7"); printf("%c",'\7');*/ printf("Hello\073\n"); print原创 2015-07-04 21:29:07 · 3397 阅读 · 0 评论