摘要:
#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 阅读全文
摘要:
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 阅读全文
摘要:
/*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])... 阅读全文