自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 资源 (13)
  • 收藏
  • 关注

原创 c++ 通用类型

c++ 通用类型 类似any实现:#include <iostream>#include <typeinfo>using namespace std;class __base_type {public: virtual const char* get_id_name()=0;//验证类型名称};/*!* \class real_type** \brief 数据实体:需要使用

2016-04-14 20:28:20 3796

翻译 PhysicsJS

JS物理引擎库。瞬间让虚拟世界变得真实。http://flippinawesome.org/2013/12/02/building-a-2d-browser-game-with-physicsjs/原文地址步骤0:虚无的空间在一切的开始。我们需要设置我们的html。我们使用HTML cavas来渲染。所以从你的标准HTML5模板开始。我假设scripts在body的末尾加载

2014-03-27 12:50:47 1792

原创 C++类

C++中类以class 关键字声明class MyClass{public:int s;};值得注意到是在末尾要加上;数据结构:权限public公共:内外都可调用protect内部或其子类中调用private仅仅内部静态数据为该类的公共数据,也就是该类的所有变量的该数据都相同。友元函数:cla

2013-08-24 11:00:53 581

原创 类的构造与析构

class T{public: int n[1000]; char w; T():pre(0),next(0){ w='0'; ::memset(n,0,1000);cout<<w<<":creat\n";} T(char name):pre(0),next(0){ w=name;cout ~T(){ cout<<w<<":delete\n"; if(pre) {//pr

2013-08-24 10:55:34 835 1

原创 类的构造与析构

class T{public:int n[1000];char w;T():pre(0),next(0){ w='0';::memset(n,0,1000);cout~T();if(next) next->~T ();cout<<w<<":delete\n";}T* pre;T* next;T operator +(T& a){ T* t=new T('n');t->pre=this;t->n

2013-08-24 10:20:20 715

原创 #define and typedef

#define 是文本替换,在编译时编译器自动替换。 typedef 就是type define类型定义,是一种更安全的替换。基本用法typedef int; INT; #define INT int2者差异出来了,首先是别名位置上的差异,再是typedef是一个语句,需要;是程序的一部分,而#define是告诉编译器的。以前我以为这只是小事,换个名字而已所以没好好学过。但事实

2013-08-24 10:17:04 777

转载 volatile关键字

volatile的本意是“易变的” volatile提醒编译器它后面所定义的变量随时都有可能改变,因此编译后的程序每次需要存储或读取这个变量的时候,都会直接从变量地址中读取数据。如果没有volatile关键字,则编译器可能优化读取和存储,可能暂时使用寄存器中的值,如果这个变量由别的程序更新了的话,将出现不一致的现象。http://www.cnblogs.com/yc_sun

2013-08-19 14:34:46 486

原创 C中的位操作

先介绍下位运算符:位与:&(只有2个true时为true); 位或 :|(只有2个false时为false);位异或: ^(2个不一样时为true);位反:~ ;还有左移动>;再介绍个关键字register 这个意思是吧变量存到寄存器上提高读取速度。我想位运算都是快捷的,也该用快捷的变量。位运算的妙用:异或操作的性质:满足结合律和交换律。a^a=0;a^0=a;2个

2013-08-19 14:16:29 636

原创 C的输入和输出

输入函数:scanf(%d,&a);第一个参数与第二个参数的类型有关。%s为字符串;%c为字符;

2013-08-19 11:54:50 643

原创 string的使用

string类型的原型为char ,加入各种功能成为一个类。可以很方便的s1+s2+"asd"进行这类简单明了的操作。(这绝对是C++的优势)。在成员函数上,基本和向量容器vector一样。在实际运用中最头痛的莫过数据转化了。string 转 char * string s;strcpy(char*,s.c_str());char 转stringstring t;

2013-08-06 14:45:15 616

原创 ThreeColorabilityEasy

Problem Statement  There is a H times W rectangle divided into unit cells. The rows of cells are numbered 0 to H-1 from top to bottom, and the columns are numbered 0 to W-1 from left to ri

2013-08-06 14:01:07 737

原创 InsertZ

Problem Statement  You are given two strings: init and goal. Bothinit and goal contain lowercase letters only. Additionally,init does not contain the character 'z'. Your goal is to t

2013-08-06 10:49:19 1451

原创 C:各种数据转化

原型: int atoi(const char *nptr);   函数说明: 参数nptr字符串,如果第一个非空格字符不存在或者不是数字也不是正负号则返回零,否则开始做类型转换,之后检测到非数字(包括结束符 \0) 字符时停止转换,返回整型数。

2013-07-24 09:15:13 697

原创 SRM 558 backup 1div 1

Problem Statement  There are some red points and blue points on the Cartesian plane. All red points are on the x-axis and all blue points are in the upper half-plane. That is, the y-coordina

2012-12-16 07:47:26 536

原创 SRM559

Problem Statement  In the Land of Winter lives the Toy King. The Toy King owns many fields and in each field he has control over different plots of land. The Toy King also has nine lords und

2012-11-17 22:11:33 429

原创 srm 558 backup 1 DIV 2

Problem Statement  Cat and Rabbit are going to play the following game.There are some tiles in a row. Each of the tiles is colored white or black. You are given a stringtiles, describing

2012-10-28 08:43:16 462

原创 算法连载6

Problem Statement  Little Fox Jiro has a rectangular board. On the board there is a row of N unit cells. The cells are numbered 0 through N-1 from the left to the right. Initially, the cells

2012-10-27 16:45:16 472

原创 算法连载5:

Problem Statement  Surrounding Game is a single-player game played on a rectangular grid of cells. Cells are considered adjacent if they share a common side. (Hence, each cell has at most fo

2012-10-20 16:48:33 352

原创 算法连载4

Problem Statement You just bought a very delicious chocolate bar from a local store. This chocolate bar consists of N squares, numbered 0 through N-1. All the squares are arranged in a singl

2012-10-04 15:10:02 397

原创 算法连载3

Problem Statement  You have N balls, where N is odd. The balls are numbered from 0 to N-1. In that order, they are arranged into a row going from the left to the right.In addition to the

2012-10-04 07:31:41 359

原创 million contestants:算法分析

Problem Statement  Exactly one million contestants, numbered 1 through 1,000,000, took part in a programming contest. The rules of the contest are simple: the winner is the contestant who

2012-09-22 18:07:27 463

原创 算法连载2:跳蚤问题

今天的算法是个1000Points的。Problem Statement  The amazing flea circus Nehryzma is in town! The most famous act of this flea circus looks as follows: On the table there are N marked s

2012-09-16 14:21:16 759

原创 物体与曲面的碰撞

我在做一个小游戏,需要一些碰撞,于是我就想了一个算法:把圆边缘与曲线的碰撞转化为 圆心与地形的碰撞。首先我的物体是圆形的,当然其他图形也可以用圆近似代替或分割。 地形曲面是任意的,我的程序是用函数表达的。如图,圆下落时不能直接知道接触点的位置,因此我的算法主要是得到近似的触点。如果把地形函数f(x)延斜率方向 延长r,得到一个新的函数g(x).g(x)与圆心的相交足以说

2012-06-17 13:39:22 655

opengl小程序

很久以前写的代码。是一个利用opengl写的小游戏。依据加速度、摩擦力、弹性碰撞的物理模型,写的一个在地面上的滚动球。

2016-08-07

安卓H5技术通讯录

在使用hbuilder构建安卓app时,无法直接使用java。需要使用js语言进行开发。plus对象集成了原生app需要的一些功能。其中h5中localstorage可以做本地数据存储

2016-04-24

手机用户登录界面demo

使用hbuild开发利用html制作登录界面。 还有计算器、投票界面。

2016-04-16

c++通用类型

定义一个通用类型virtual_type 可以接受任何类型的数据。 可以将一个数据存入该类型后,传递给其他函数,再将数据取出。从而编写出万用函数。 算是对模板函数的增强。

2016-04-15

学生成绩管理系统设计实验

设计一个学生成绩管理系统,要求完成文件建立、学生成绩录入、显示指定学号的学生记录、删除一个学生的记录、修改学生记录、返回等工作。学生成绩包括学号(XH)、姓名(XM)、数学(SX)、语文(YW)、外语(WY)字段

2016-01-03

普通网站管理平台

个人网页源代码,仅供学习参考。请勿直接修改使用。

2015-05-14

clever007游戏代码

使用cocos2d技术编写的网页游戏,少量涉及PHP。主要由js编写。考验记忆力,还原路径。

2015-05-14

pysicsJS物理引擎

简单的js物理引擎,使用改进版的牛顿法。有重力系统和碰撞系统。支持多边形的很值得学习

2014-06-03

俄罗斯方块

大一做的简单游戏。除了基本的俄罗斯方块游戏功能,还加入了游戏的录制。能够回放游戏过程。~.!奇葩功能,老师要求哈。。

2014-05-28

TOPCODER比赛作品

topcoder的比赛作品,编译通过的。可以放心使用。

2012-08-10

完美碰撞的BALL

滚动球的小游戏。没有做地图编辑器,本来想吧代码发来的,我写的太乱不好意思献丑。

2012-06-23

翻滚吧,ball

小游戏,模拟了碰撞、滚动、牛顿定律。我想编个更好的,求同伴啊

2012-06-08

爱心示例程序

一个爱心示例OPENGL写的!!,内容有些简陋希望大家喜欢

2012-05-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除