原创 在TS語言H5項目中使用Protobufjs(二) - Layaair臘鴨引擎篇

大家好,又見面了,上一篇我們介紹瞭如何在Egret中使用Protobufjs。 至於爲什麼選protobufjs,請點擊這裏閱讀我上一篇文章 這篇我們重點介紹,如何在Layaair的TS項目中使用它。 首先,因爲我用的是ts版本創建的項目

原创 Directx 繪製一四邊形 並且繞Y軸順時針勻速轉動

#include <d3dx9.h> #include <string> #include <tchar.h> #pragma warning(disable: 4996) #include <strsafe.h> #pragma war

原创 求兩個數的最大公約數和最小公倍數

#include<stdio.h> int qzdgys(int m,int n) /*求最大公約數*/ { int min; if(m<=0||n<=0) return -1; if(m>n) /*取輸入的兩個數

原创 返回指針的函數

#include <iostream> using namespace std; int *search(int (*p)[4]); int main() { int a[][4] = {{71,82,83,64},{5,6,7,8

原创 Vector求期末成績

#include<iostream> #include <string> #include <stdexcept> #include <iomanip> #include <algorithm> #include <vector> usi

原创 把一個合數分解爲幾個質因數相乘

#include <stdio.h> int a(int a){ int i; for(i=2; i<a; ++i) if(a%i == 0) return 0; //a爲合數時返回0 return 1; //a爲質數時

原创 Directx 紋理貼圖 模仿地面效果

#include <d3dx9.h> #include <string> #include <tchar.h> #pragma warning(disable: 4996) #include <strsafe.h> #pragma war

原创 利用鍵值對統計單詞出現的次數

#include <iostream> #include <string> #include <vector> #include <map> //使用關聯式容器map<鍵,值> m using namespace std; void

原创 輸出迭代器 ostream_iterator 把輸入的一串字符按每行一個單詞輸出

//split頭文件 #include <algorithm> #include <iostream> #include <iterator> #include <string> #include <cctype> using name

原创 求f(x)=1-x的2次方的定積分

//求f(x)=1-x2的定積分 #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> double p(int n) { double

原创 輾轉相除法求兩個數是否互素

#include <iostream> using namespace std; int gcd(int x,int y); void main() { int x,y; cin>>x>>y; if(gcd(x,y)==1)

原创 在一個矩形框中輸出一條問候語

第一個版本 // ask for a person's name, and generate a framed greeting #include <iostream> #include <string> int main() { s

原创 統計各單詞出現的行數---鍵值對

#include <cctype> #include <iostream> #include <string> #include <vector> #include <map> //使用關聯式容器map<鍵,值> m using nam

原创 調用拷貝構造函數的三種形式

#include <iostream> #include <string> using namespace std; class MyClass { public: MyClass(int x1 = 1, int y1 = 2);

原创 Direct3D 初始化

       工程包含了三個文件,分別是 d3dUtility.h   d3dUtility.cpp  d3dInit.cpp      d3dUtility.h #ifndef _d3dUtilityH_ #define _d3