文章分类 -  C++

摘要:有三根相邻的柱子,标号为A,B,C,A柱子上从下到上按金字塔状叠放着n个不同大小的圆盘,要求把所有盘子一个一个移动到柱子C上,并且每次移动同一根柱子上都不能出现大盘子在小盘子上方。定义函数 void fun(盘数, 始发位置, 中间位置, 到达位置); void fun(int n,char... 阅读全文
posted @ 2015-03-27 11:19 薛晓东 阅读(168) 评论(0) 推荐(0)
摘要:1 int* insertionSort(int datas[],int len) 2 { 3 int* temp = new int[len];// 定义一个指向数组的指针 4 int i,x; 5 6 for(int j=1;j=0)11 {12 ... 阅读全文
posted @ 2015-03-24 16:17 薛晓东 阅读(482) 评论(0) 推荐(0)
摘要:1 #include 2 3 void function(int datas[],int len) 4 { 5 for(int j=0;j<len;j++) 6 { 7 cout << datas[j] << endl; 8 } 9 }10 11 int... 阅读全文
posted @ 2015-03-24 15:02 薛晓东 阅读(201) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 4 int main(int argc, char* argv[]) 5 { 6 cout usingnamespacestd;floatFuncP(inta,floatb){returna+b;}intFuncNP(){return3... 阅读全文
posted @ 2015-03-24 11:12 薛晓东 阅读(131) 评论(0) 推荐(0)
摘要:There are five data types for C: void, integer, float, double, and char.TypeDescriptionvoidassociated with no data typeintintegerfloatfloating-point n... 阅读全文
posted @ 2015-03-24 10:27 薛晓东 阅读(125) 评论(0) 推荐(0)
摘要:整型 1,在java中,整型的范围与运行java代码的机器无关,从而解决在不同平台之间移植的问题。例如:byte型占1个字节,short型占2个字节,int型占4个字节,long型占8个字节。相反,在C或者C++中,程序会根据不同的处理器现则最为有效的整型。这也是C++效率较高的一个原因。 2,在j... 阅读全文
posted @ 2015-03-23 17:44 薛晓东 阅读(1276) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 5 void main() 6 { 7 ifstream inFile; 8 ofstream outFile; 9 outFile.open("my.txt", ios::out);10 ... 阅读全文
posted @ 2015-03-23 16:15 薛晓东 阅读(127) 评论(0) 推荐(0)
摘要:#include void main(){ int a,b; cin >> a >> b; cout Settings->C/C++->Precompile Header,设置为第一项:Not using precompile headers。 解决方案2:在.cpp文件开头添加包含文件s... 阅读全文
posted @ 2015-03-23 15:37 薛晓东 阅读(181) 评论(0) 推荐(0)