摘要: #includeusing namespace std; void Foo1(int arr[3]) { cout << "pass by pointer: " << sizeof(arr) << endl; } void Foo2(int (&arr)[3]) { cout << "pass by reference: " << sizeof(arr) << endl; } void Foo3(int *arr) { cout << "pass by 阅读全文
posted @ 2013-07-18 20:51 开心成长 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 1、阶乘#includeusing namespace std;int fac(int n){ int result=1; if(n>n; cout<<fac(n)<<endl; return 0;}输入5;输出2、3、4、5、120 阅读全文
posted @ 2013-07-18 20:13 开心成长 阅读(217) 评论(0) 推荐(0) 编辑
摘要: /*PROB:beadsLANG:C++*/#include#include#include #include #includeusing namespace std;string strReverse(string str1){ int len=str1.size(); string str2=str1; char *end=&str1[0]+len-1; for(int i=0;i&str1[0]){ str2[i]=end[0]; end--; } else if(end==&str1[0])... 阅读全文
posted @ 2013-07-18 11:02 开心成长 阅读(419) 评论(0) 推荐(0) 编辑