随笔分类 -  unAccepted

上一页 1 2

PE: 行末不留空格 BST 插入与遍历
摘要:PE了一早上——就是因为行末空格的问题想过用链表在遍历过程中存储节点,然后打印;想过用静态变量保存;最后,回到了指针,传递计数器的地址。View Code //1005 BST 建树、遍历# include <stdio.h># include <stdlib.h>typedef struct Tnode{ int key; struct Tnode *left; struct Tnode *right;}node;node *BST_insert(node *root, node *p);void preorder(node *x, int *p);void inor 阅读全文

posted @ 2012-02-17 13:05 getgoing 阅读(268) 评论(0) 推荐(0)

C语言的一个关于类型的小陷阱
摘要:类型的差别造成奇怪的运行结果——输出错误、无法继续输入等新增:找出下面代码的错误:# include <stdio.h># include <string.h> # define MAXN 10005 int main(){ short m, n, i, ans, tmp, t[MAXN]; while (~scanf("%d%d", &n, &m)) { memset(t, 0, sizeof(t)); for (i = 1; i <= m; ++i) { scanf("%d", &tmp); .. 阅读全文

posted @ 2012-02-16 18:37 getgoing 阅读(313) 评论(0) 推荐(0)

csu1002 A+B(III)
摘要:RE 阅读全文

posted @ 2012-02-16 16:29 getgoing 阅读(459) 评论(0) 推荐(0)

bfs poj2965
摘要:TLE了 不知道怎么办 还是用枚举?// poj 2965 bfs & STL queue# include <iostream># include <cstring># include <queue>using namespace std;const unsigned short flip[] = {0x111f, 0x222f, 0x444f, 0x888f, 0x11f1, 0x22f2, 0x44f4, 0x88f8, 0x1f11, 0x2f22,... 阅读全文

posted @ 2012-02-16 00:07 getgoing 阅读(220) 评论(0) 推荐(0)

上一页 1 2

导航