开发工具:
文件大小: 260kb
下载次数: 0
上传时间: 2014-04-16
详细说明:
一.阅读程序题 1. #include class CSample { int i; public: CSample() { i=1; cout< class Sample { private: int x; public: Sample(){ cout<<(x=0);} Sample(int i,int j) {cout<<(x=i+j);} ~Sample(){cout< class Sample { public: Sample(){} Sample(int a){x=a;} Sample(Sample &a){x=a.x++;} void disp(){cout< class Sample { int x; public: Sample(){x=0;} Sample(int a) {cout<<(x=a);} ~Sample() { cout<<++x; } void disp() { cout< class Sample { int x; public: Sample(){cout<<(x=0);} Sample(int i){cout<<(x=i);} ~Sample(){cout< class Sample { public: Sample(){cout<<"Constructor"< class Sample { int n; public: Sample(int i){n=i;} friend int add(Sample &s1,Sample &s2); }; int add(Sample &s1,Sample &s2) { return s1.n+s2.n; } void main() { Sample s1(10),s2(20); cout< class B; class A { int i; public: int set(B&); int get(){return i;} A(int x){i=x;} }; class B { int i; public: B(int x){i=x;} friend A; }; int A::set(B &b) { return i=b.i; } void main() { A a(1); B b(2); cout< float f(float x, float y) { return x+y; } int f(int x, int y) { return x+y; } void main() { float a, b, c; a = b = 50.5; c = f(a, b); cout << c; } 10. #include int max(int x, int y) { if(x > y) return x; else return y; } int max(int x, int y, int z) { return max(x, max(y, z)); } void main() { int a = 3, b = 4, c = 5, d = 0; d = max(a, b); cout << d; } 11. #include int p(int x = 4, int y = 5) { return x + y; } void main() { int a = 3, b = 4, c = 0; c = p(b); cout << c; } 12. #include int add(int x, int y = 8); void main() { int a = 6; cout << add(a, add(a)) << endl; } int add(int x, int y) { return x + y; } 13. #include int p(int x = 4, int y = 5, int z = 6) { return x + y + z; } void main() { int a = 3, b = 4, c = 5; c = p(b, a); cout << c; } 14. #include int p(int x = 4, int y = 5, int z = 6) { return x + y + z; } void main() { int a = 3, b = 4, c = 0; c = p(b, c); cout << c; } 15. #include int n = 1; void Fun(); void main() { n++; Fun(); if(n > 0) { int n = 5; cout<< "Block:n=" << n << ","; } cout << "Main:n = " <
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.