// CTest.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;typedef char ElemType;struct GLNode{ bool tag; /...
分类:
编程语言 时间:
2015-06-03 22:57:38
阅读次数:
129
在用递归写八皇后时,定义了一个全局变量count,结果出现问题如下:提示全局变量不明确。
最后发现在实现文件.cpp中,我使用了using namespace std;
解决方法:
1.使用count 的地方改成 ::count 替代(因为std命名空间下也有 std::count ,编译器不确定此处是::count 还是std::count,所以会不明确)
...
分类:
其他好文 时间:
2015-06-03 21:41:39
阅读次数:
251
题目:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note...
分类:
其他好文 时间:
2015-06-03 21:23:50
阅读次数:
102
VC6.0是微软1998年发布的,是一款很经典的编辑器,然而它有几个很常见的bug,比如, .cpp文件打不开,智能提示出现异常,这里介绍“VC6.0的ClassView里不能显示类或成员变量”问题的解决方法。详细步骤如下:
1) 关闭VC6.0,找到工程目录里的.clw文件,按Del键删除该 .clw文件,如图(1)所示: 图(1)按Del键删除.clw文件
2)打开VC6....
分类:
其他好文 时间:
2015-06-03 19:40:14
阅读次数:
137
// CTest.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #include using namespace std;typedef int ElemType;struct Stack{ ElemType data; ...
分类:
编程语言 时间:
2015-06-03 19:11:31
阅读次数:
123
[cpp] view
plaincopy
int a=0;
std::cout
boost::thread t1([&](){
for (int cnt=0;cnt
{
a+=1;
}
});
boost::thread t2([&](){
for (...
分类:
其他好文 时间:
2015-06-03 17:48:18
阅读次数:
426
题目:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representat...
分类:
其他好文 时间:
2015-06-03 15:33:00
阅读次数:
168
问题及代码:
/*
*Copyright (c)2015,烟台大学计算机与控制工程学院
*All rights reserved.
*文件名称:project.cpp
*作 者:陈文青
*完成日期:2015年6月3日
*版 本 号:v1.0
*
*问题描述:显然,Animal设计为抽象类更合适,Animal不需要能够实例化,是专门作基类使用的。
改造程序,使Animal设...
分类:
其他好文 时间:
2015-06-03 09:47:54
阅读次数:
132
问题及代码:
/*
*Copyright (c)2015,烟台大学计算机与控制工程学院
*All rights reserved.
*文件名称:project.cpp
*作 者:陈文青
*完成日期:2015年6月3日
*版 本 号:v1.0
*
*问题描述:写一个程序,定义抽象基类Shape,由它派生出3个派生类,Circle(圆形)、Rectangle(矩形)、Trian...
分类:
其他好文 时间:
2015-06-03 09:46:33
阅读次数:
108
问题及代码:
/*
*Copyright (c)2015,烟台大学计算机与控制工程学院
*All rights reserved.
*文件名称:project.cpp
*作 者:陈文青
*完成日期:2015年6月3日
*版 本 号:v1.0
*
*问题描述:每一个Animal的派生类都有一个“名字”数据成员,这个成员设置为基类Animal的成员更好。
改造上面的程序,将“...
分类:
其他好文 时间:
2015-06-03 09:45:25
阅读次数:
122