自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(45)
  • 资源 (6)
  • 收藏
  • 关注

转载 java 堆栈

import java.util.*;public class StackDemo { static void showpush(Stack st, int a) { st.push(new Integer(a)); System.out.println("push(" + a + ")"); System.out.println("stack: "

2013-09-01 11:29:19 626

转载 directx 初始化

转自http://blog.csdn.net/poem_qianmo/article/details/7774929#include#pragma comment(lib, "d3d9.lib")#pragma comment(lib, "d3dx9.lib")#define WINDOW_CLASS "UGPDX"#define WINDOW_NAME "Drawing Lines

2013-08-25 06:39:11 933

原创 汇编中的乘法

//下面我们计算123x236assume cs:code code segmentmov ax,0mov cx,236s: add ax,123loop smov ax,4c00h ;结束计算int 21hcode endsend

2013-08-24 07:00:22 1508

原创 socket编程

/* //客户端#pragma comment(lib, "ws2_32")#include #include #include int main(){WSADATA wsaData;::WSAStartup(0x0202,&wsaData);//initSOCKET sLocal=socket(AF_INET,SOCK_STREAM,0);sockaddr_in addr

2013-08-24 00:53:12 549

原创 找出第n大元素

#include #include #include #include int main(){ std::vector v{5, 6, 4, 3, 2, 6, 7, 9, 3}; std::nth_element(v.begin(), v.begin() + v.size()/2, v.end()); std::cout << "The median is

2013-08-24 00:45:01 1189

原创 遗传算法解迷宫问题

/*Zhangyuan LiSiena Collegeall right reserved*/ 主函数:#include #include #include #include #include "Bobmap.h"#include using namespace std;int main(){::system("color 02");cout<<"

2013-08-21 03:18:31 1086

原创 球面映射

void draw(){glEnable(GL_TEXTURE_2D);glBindTexture(GL_TEXTURE_2D,tex);glEnable(GL_TEXTURE_GEN_S);//自动生成s方向纹理坐标glEnable(GL_TEXTURE_GEN_T);// 自动生成t方向纹理坐标drawsphere();glDisable(GL_TEXTURE_2D);}

2013-08-14 03:50:05 1552

原创 纹理贴图

bool LoadTexture(LPTSTR szFileName, GLuint &texid) // Creates Texture From A Bitmap File{ HBITMAP hBMP; // Handle Of The Bitmap BITMAP BMP; // Bitmap Structure glGenTe

2013-08-14 03:30:43 812

原创 load image (java )

import java.applet.Applet;import java.awt.Graphics;import java.awt.Image;public class image extends Applet{ Image maImage; public void init(){ maImage = getImage(getDocumentBase(),"hh.jpg");

2013-05-28 07:35:22 1040

原创 Rotate An Object(opengl)

/* * * Siena College Computer Science program * All right reserved * Albany NY * */#include // Header File For Windows#include // Header File For The OpenGL32 Library#include //

2013-05-27 06:53:02 644

原创 第一人称游戏中的矩阵运用

在制作第一人称视角相机时,我们需要制作几个相关的矩阵来实现目标点随着鼠标的角度变换。例如,绕任意轴的旋转辅助矩阵可以表示为:[R] =1 + (1-cos(angle))*(x*x-1)-z*sin(angle)+(1-cos(angle))*x*yy*sin(angle)+(1-cos(angle))*x*zz*sin(angl

2013-05-25 08:40:49 1548

原创 旋转的四个立方体

#define szClassName TEXT("3D Box Rotate")#include #include #include #include #pragma once#pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9.lib")#pragma comment(lib,"winmm.lib")

2013-05-21 09:14:06 1041

原创 windows API 加载位图

msdn定义如下HANDLE WINAPI LoadImage( _In_opt_  HINSTANCE hinst,// _In_      LPCTSTR lpszName,//输入文件名,如buffer.bmp _In_      UINT uType,//0是加载图片,1是图标,2是光标//                        IMAGE_BITMAP//

2013-05-20 07:25:03 2476

原创 贝塞尔曲线

// windowsgdi.cpp : Defines the entry point for the application.//#include "stdafx.h"#include "windowsgdi.h"#define MAX_LOADSTRING 100// Global Variables:HINSTANCE hInst; // current

2013-05-20 03:38:53 548

原创 load image

package myplane;import java.awt.BorderLayout;import java.awt.Graphics;import java.awt.Image;import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import

2013-05-15 10:03:02 678

转载 多线程

public class SaleTicketMutiThread implements Runnable  {    int tickets = 10;    @Override    public void run() {        if (tickets > 0) {                 sale();        }else{

2013-05-13 09:20:16 439

原创 google面试题

题目:写一个单链表,倒序输出。解:#include #include #include using namespace std;typedef struct node{int key;node*next;node(node*p, int m): next(p),key(m){};}*linklist,node;stackliststack;class lin

2013-05-08 09:29:06 580

原创 Scroll Bars

// Win32Lesson1.cpp : Defines the entry point for the application.//#include "stdafx.h"#include "Win32Lesson1.h"#define MAX_LOADSTRING 100// Global Variables:HINSTANCE hInst; // curren

2013-05-03 06:21:31 567

原创 virtual function

#include using namespace std;class CPolygon { protected: int width, height; public: void set_values (int a, int b) { width=a; height=b; } virtual int area (void) =0; void

2013-04-28 09:12:06 494

原创 syntax of namespace

#include using namespace std;namespace first{ int x = 5;}namespace second{ double x = 3.1416;}int main () { { using namespace first; cout << x << endl; } { using names

2013-04-24 08:53:08 462

原创 Prim's law

#include #define N 100using namespace std;int main(){ int a[5][5]={{0,4,5,6,23}, {4,0,8,9,10},{5,8,0,11,12},{6,9,11,0,13},{23,10,12,13,0} }; bool flag[5];int lowcost[4]; mems

2013-04-22 05:27:33 412

原创 windows form

// windowstutorial.cpp : Defines the entry point for the application.//#include "stdafx.h"#include "windowstutorial.h"#define MAX_LOADSTRING 100// Global Variables:HINSTANCE hInst; //

2013-04-21 10:24:18 563

原创 binary search tree

#include #include using namespace std;struct TreeNode{ int key; TreeNode *LChildNode; TreeNode *RChildNode; TreeNode(int &e, TreeNode *lchild, TreeNode *rchild):key(e), LChildNod

2013-04-21 03:15:52 426

原创 计算器

#include using std::ostream;using namespace std;templateclass calculator{public: calculator() { } calculator(const T a); calculator&operator+(calculator&p); calculator&operator-(calc

2013-04-18 09:05:02 524

原创 归并排序

#include using namespace std;void merge(int*a,int a1,int a2,int a3){ int n1,n2; int*leftarray=NULL; int*rightarray=NULL; n1=a2-a1+1; n2=a3-a2; leftarray=(int*

2013-04-17 09:42:16 408

原创 radix sort

int bits(int x,int k, int j){return (x>>k)&~(~0<<j);}radixexchange(int a[],int l,int r, int b){int t,i,j;if(r>l&&b>=0)i=l;j=r;while(j!=i){while(bits(a[i],b,1)==0&&i<j)i++;while(bits(

2013-04-17 07:19:58 538

原创 多项式类

#include using namespace std;templateclass poly{private: T x;int n;int a;public: poly() { this->x=0; this->a=0; this->n=0;} poly(T x1,int a1, int n1) { n=n1; x=x1; a

2013-04-12 02:25:53 813

转载 动画效果

#include void setrects(SDL_Rect* clip) { for(int i = 0; i < 10; i += 1) { clip[i].x = 0 + i*100; clip[i].y = 0; clip[i].

2013-04-10 03:34:35 485

转载 三字棋游戏

#include "stdio.h" #include "malloc.h" #define SIZE 3 #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #define NONE 0 #define PLAYER_A 1 #define PLAYER_B 2 #define W

2013-04-09 04:27:09 746

转载 snake game

#include #include #include #include #include #ifndef SNAKE_H #define SNAKE_H struct snakepart{ int x,y; snakepart(int col,int row); snak

2013-04-08 07:17:31 875

原创 SDL ttf输入

//http://www.youtube.com/user/thecplusplusguy //Thanks for the typed in code to Tapit85 //you need a ttf font called Test.ttf and the tree_animation.bmp from the last source #include #inc

2013-04-08 07:11:28 765

原创 单词排除集

#include #include #include #include using namespace std;stack A;string str ("ilove*youtube*cplusplus");void stock(string&str){ int i=0; while(i<str.size(

2013-04-07 01:07:18 641

转载 orthogonal list

#include #include #define Rownum 4#define Colnum 4int a[4][4]={{1,3,0,3},{4,0,3,2},{5,0,2,1},{3,3,1,4}};using namespace std;typedef struct node{ int data; //the data on each node node

2013-03-30 07:46:26 634

原创 汇编1

C:\Users\danny>cd desktopC:\Users\danny\Desktop>debug-a 1000B68:0100 jmp 1150B68:0102 db 'Hello world$'0B68:010E-a 1150B68:0115 mov ah,090B68:0117 mov dx,1020B68:011A int 210B68:01

2013-03-30 04:14:40 443

原创 二分查找

二分查找这种手法相对于别的查找法更简洁明了,时间复杂度为n(logn).设 int a[10]={1,3,4,5,6,7,8,9,10,13};可以这样来理解:有十把钥匙,0,1,2,3,4...9, 每一把对应于一个有顺序的房子序列,不妨设其为1,3,4,5,6,7,8,9,10,13,查理要找一个价值为10万美元的房子。第一步,找中间那个,int i=[0+9/2]=4。  [n]是高斯函数,

2013-03-28 09:46:29 462

原创 单链表

#include using namespace std;typedef struct node{ int val; struct node*next;}node,*linklist;node*creatlist(int&n)//back insert{ int a; linklist p,q; p=new n

2013-03-24 10:02:48 419

原创 寻找因数

#include # include using namespace std;class integer{public: integer(){ int a;cout<<"please input a integer n"<<endl;cin>>a;} int factor( int &n, int*b);void PrintNum();~integer(){

2013-03-24 04:51:39 927

原创 组合数

#include #include using namespace std;int main(){ char s[]="abcdefgh"; int i,j,k; int b; b=strlen(s);//get the length; for(i=0;i<=b;i++)//make a loop to find all t

2013-03-23 10:43:27 507

原创 collision detect--SDL lib

#include SDL_Surface*screen=NULL;SDL_Surface*background=NULL;SDL_Surface*sprite=NULL;int SCREEN_WIDTH=640;int SCREEN_HEIGHT=480;int width=32;int height=32;int dstX=0;int dstY=0;bool ga

2013-03-20 06:09:52 839

转载 josephus list

#include using namespace std;typedef struct node{int data;struct node*next;}node, *linklist;node*creatlist(int n)//pushfront{ int i; linklist head,p;head=(node*)malloc(sizeof(node));if(!h

2013-03-18 00:21:43 426

java 基础教学

java 全方面教学,代码全 United State oracle crop all right reserved

2013-05-13

3D射击游戏

opengl, blender,详细代码

2013-05-13

java 冒险岛游戏源码

小游戏代码,please subscribe me ,all right reserved.

2013-05-13

黑客编程入门

黑客入门必读,高手可以参考 don't change the version all right reserved .

2013-05-07

汇编 by wangshuang

简单的入门编程教材 for the beginner to enter the field of coding and basic designing

2013-05-07

effective c++ 3rd

good for the student and the teachers

2013-02-05

空空如也

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

TA关注的人

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