![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++基础
lie隼
这个作者很懒,什么都没留下…
展开
-
使用默认参数的构造函数
#include using namespace std;class Box{public: Box(int h=10,int w=10,int len=10); int volume();private: int height; int width; int length;};Box::Box(int h,int w,int len){原创 2013-11-01 17:16:08 · 531 阅读 · 0 评论 -
C++求斐波那契数列的第n项
#include using namespace std;int fib(int n);int main(){ int a; while(cin>>a) { cout<<"the result: "<<fib(a)<<endl; } return 0;}int fib(int n){ if(n==1||n==2)原创 2016-08-24 16:06:40 · 9629 阅读 · 0 评论