10 2013 档案
摘要:DescriptionLet x and y be two strings over some finite alphabet A. We would like to transform x into y allowing only operations given below:Deletion: a letter in x is missing in y at a corresponding position.Insertion: a letter in y is missing in x at a corresponding position.Change: letters at corr
阅读全文
摘要:Problem DescriptionRecently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin is placed in the top right corner(1,m). Each time one people can move the coin into the left, the undern
阅读全文
摘要:Problem Description十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫《勇敢者的游戏》(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻。 今天,大家选择上机考试,就是一种勇敢(brave)的选择;这个短学期,我们讲的是博弈(game)专题;所以,大家现在玩的也是“勇敢者的游戏”,这也是我命名这个题目的原因。 当然,除了“勇敢”,我还希望看到“诚信”,无论考试成绩如何,希望看到的都是一个真实的结果,我也相信大家一定能做到的~各位勇敢者要玩的第一个游戏是什么呢?很简单,它是这样定义的: 1、 本游戏是一个二人游戏; 2、 有
阅读全文
摘要://///////////////////////////////////////////////////////////////////////////// Name: personalrecord.h// Purpose: Dialog to get name, age, sex, and voting preference// Author: Julian Smart// Created: 02/28/04 06:52:49// Copyright: (c) 2004, Julian Smart// Licence: wxWindows...
阅读全文
摘要:#ifndef _WORKER_H_#define _WORKER_H_#include /**using std::cout;using std::cin;using std::endl;/**> id; while(cin.get() != '\n') { continue; }}/**> panache; while(cin.get() != '\n') { continue; }}/**> voice; while(cin.get() != '\n') { continue; }}/**#i...
阅读全文
摘要:#ifndef _STUDENT_H_#define _STUDENT_H_#include #include #include class Student : private std::string, private std::valarray{private: typedef std::valarray ArrayDb; //private method for scores output std::ostream & arr_out(std::ostream & os) const;public: Student() ...
阅读全文
摘要:#ifndef _STUDENT_H_#define _STUDENT_H_#include #include #include class Student{private: typedef std::valarray ArrayDb; std::string name; //contained object ArrayDb scores; //contained object //private method for scores output std::ostream & arr_out(std::ostream & os) const;publi...
阅读全文
摘要:// Name: minimal.cpp// Purpose: Minimal wxWidgets sample// Author: Julian Smart#include "wx/wx.h"// Declare the application class//定义应用程序类class MyApp : public wxApp{public: // Called on application startup //这个函数将会在程序启动的时候被调用 virtual bool OnInit();};// Declare our main frame...
阅读全文
摘要:#ifndef _ACCTABC_H_#define _ACCTABC_H_//(*#include #include //*)//Abstract Base Classclass AcctABC{private: std::string fullName; long acctNum; double balance;protected: struct Formatting { std::ios_base::fmtflags flag; std::streamsize pr; }; const std::string & Fu...
阅读全文
摘要:#ifndef _BRASS_H_#define _BRASS_H_#include //Brass Account Classclass Brass{private: std::string fullName; long acctNum; double balance;public: Brass(const std::string & s = "Nullbody", long an = -1, double bal = 0.0); void Deposit(double amt); virtual void Withdraw(double amt); ...
阅读全文
摘要:本文摘自http://www.cnzui.com/?p=962在原文的基础上根据自己的实践做了一些修改我的IDE为C::B 12.11,wxWidgets版本为wxWidgets-2.8.12在上一篇文章中我们已经编译好了wxWidgets-2.8.12的四个版本的库编译好的库文件在wxWidgets-2.8.12\lib里面,动态库为gcc_dll,静态库为gcc_lib,调试版和发行版的区别在于文件名中调试版比发行版多了一个字母:d一、使用静态库开发wxWidgets程序首先选择MINGW做为默认编译器,然后再打开“Settings”->“Global Variables…”,在设置
阅读全文
摘要:教程摘自网上各大博客、贴吧、论坛,结合自己的实践做了一些实质性的修改。一、安装首先从http://sourceforge.net/projects/wxwindows/files/2.8.12/wxMSW-2.8.12-Setup.exe/download上下载wxWidgets2.8.12。建议将其安装某个驱动器的根目录下,比如:E:\ wxWidgets-2.8.12 目录下(尾部数字以您所使用的wxWidgets版本为准)。二、编译上一步安装wxWidgets,仅得到源代码文件及一些说明。我们还需要将其中的源代码编译成“库”文件。今天我们将把wxWidgets编译译成四种形式:动态链接库
阅读全文
摘要:最近在学C++,这个是照葫芦画瓢的五子棋C++版- -依赖SDL_PingGe_1.3,很多实用的函数,类我都封装成DLL了调用起来真是舒服啊。。不过一方面要对DLL做测试,一方面要开发,一个人还真是累啊。按钮我也取消了,毕竟只是花架子,比C版多了一个开场动画,鼠标也被修改成了一只小手,还有分出胜负后五子将会被一条红线连接(这方面的数据交互没做好)AI部分做了些修改,细化了计分表,总体水平强了不少,但是同学说缺少攻击性,哈哈没办法啦,暂时不去优化了。其实还有一个小BUG。。但是我很懒,也没那么多时间去仔细检查AI部分了,留给大家吧BUG:当中间部位还差一子便可连成五子时,AI本应是最优先落中间
阅读全文
摘要:人生第一个图形界面程序,拉出来纪念纪念- -数据共享上基本上全是全局变量,也没有任何FPS限制。。当然没有图片你也是运行不了的,就当作参考吧,AI部分很简单的按照一个计分表来算分//SDL头文件#include #include #include #include #include "SDL/SDL.h"#include "SDL/SDL_image.h"#include "SDL/SDL_ttf.h"#include "SDL/SDL_mixer.h"//#program comment(lib,"SD
阅读全文
摘要:这篇随笔专门做SDL的DLL开发。下面这个版本暂且称为Beta版本吧。/* typedef void (*FUNCTION)(void); HMODULE HDll; HDll = LoadLibrary("SDL_PingGe.dll"); if(HDll == NULL) { printf("Load library failed!\n"); FreeLibrary(HDll); return 0; } FUNCTION fun = FUNCTION(GetProcAddress(HDll,MAKEINTR...
阅读全文