摘要: 1.code.cpp:1:21: fatal error: iostream : No such file or directory #include ^compilation terminated.这个情况可能是在代码中写成这样 #include就是在头文... 阅读全文
posted @ 2014-08-06 18:51 gongpixin 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 题意:从 节点1出发,一笔画出 圣诞老人的家(所谓一笔画,就是遍访所有边且每条边仅访问一次)。思路:深度优先搜索(DFS算法)#include#include#includeusing namespace std;int map[6][6];void makemap(){ memset(map... 阅读全文
posted @ 2014-08-06 16:32 gongpixin 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 思路:宽度优先搜索(BFS算法) #include#include#include#includeusing namespace std;int a,b;struct node{ int num; int step;};node que[10000];//默认初始化为0int visit[10000... 阅读全文
posted @ 2014-08-06 14:50 gongpixin 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 使用时注意类型,可见两者皆不可以用int1.pow函数声明: double pow (double base , double exponent); float pow (float base , float exponent);long double pow (... 阅读全文
posted @ 2014-08-06 14:17 gongpixin 阅读(618) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;int a[5];//默认初始化为0int main(){ int b[5];//随机值 int c[5]={3};// c[0]=3,其他初始化0 return 0;} 阅读全文
posted @ 2014-08-06 11:29 gongpixin 阅读(589) 评论(0) 推荐(0) 编辑