- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 三种水桶,等分为两半问题
问题原型: 三只水桶条件:1号8升、2号5升、3号3升,并且没有刻度。初始状态为1号桶装满水,目标状态为把水等分为2份。 思路: 建立状态模型: 状态为 struct BulketState { int Bulkets[3]; //如{800}{503}等 } 行为有六种(1表示得到水,-1表示倒出水,0表示不动),{1、-1、0}{1、0、-1}{0、-1、1}{0、1、-1}
2013-07-04 15:44:23 489 1
转载 vs2008 中auto_ptr
// TEMPLATE CLASS auto_ptr template class auto_ptr; template struct auto_ptr_ref { // proxy reference for auto_ptr copying explicit auto_ptr_ref(_Ty *_Right) : _Ref(_Right) { // construct fr
2013-07-02 12:06:55 509
转载 win32临界代码段使用
namespace fs { //封装临界对象 class Critical_Section { public: Critical_Section() { InitializeCriticalSection(&m_Cs); } ~Critical_Section() { DeleteCriticalSection(&m_Cs); } void En
2013-07-02 11:17:24 315
转载 测试两个类型是否可以进行隐式转换
namespace fs { //测试是否存在从T到U的隐式类型转换 template class ExistConvert { static T MakeT(); static char Test(U); //隐式类型转换 static int Test(...); public: enum{exist = (sizeof(Test(MakeT())) == sizeof(
2013-07-02 11:02:54 345
计算机组成与系统结构
2010-06-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人