上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 54 下一页
摘要: 源程序: #include <iostream>using namespace std; class Test{ int x, y;public: void fun(int i, int j) { x = i; y = j; } void show() { cout << "x=" << x; if 阅读全文
posted @ 2020-02-06 14:42 bobo哥 阅读(125) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;class Test{private: int x, y;public: Test(int i, int j) { x = i; y = j; } int getx() { return x; } int get 阅读全文
posted @ 2020-02-06 14:37 bobo哥 阅读(155) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;int bigger(int x, int y){ if (x > y) return x; else return y;} float bigger(float x, float y){ if (x > y) 阅读全文
posted @ 2020-02-06 14:25 bobo哥 阅读(124) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>#include <cmath>using namespace std; int f(int);int main(){ int i; for (i = 0; i < 3; i++) cout << f(i) << endl; system("pause 阅读全文
posted @ 2020-02-06 14:19 bobo哥 阅读(143) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;int main(){ int oneInt = 1; int &ref = oneInt; ref = 2; cout << "oneInt=" << oneInt << "," << "ref=" << re 阅读全文
posted @ 2020-02-06 14:15 bobo哥 阅读(145) 评论(0) 推荐(1)
摘要: 源程序: #include <iostream>using namespace std;class A{public: int fun(double); int fun(int);};int A::fun(double x){ return (int)x / 2;} int A::fun(int x 阅读全文
posted @ 2020-02-06 14:10 bobo哥 阅读(131) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std; const double pi = 3.14159;int main(){ double r; cout << "输入r:"; cin >> r; double l = 2.0*pi*r; double s = 阅读全文
posted @ 2020-02-06 14:05 bobo哥 阅读(209) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;int main(){ const int x = 5, y = 6; const int *p = &x; p = const_cast<int *>(&y); cout << *p << endl; syst 阅读全文
posted @ 2020-02-06 14:00 bobo哥 阅读(124) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream>using namespace std;void func(int a, int b, int c = 0){ cout << a << b << c << endl;}int main(){ func(5,9); system("pause"); r 阅读全文
posted @ 2020-02-06 13:57 bobo哥 阅读(135) 评论(0) 推荐(0)
摘要: 源程序:用面向对象方法又做一遍 #include <iostream>#define N 10using namespace std; template <typename T> class sum_array{private: T a[N];public: sum_array(T a1[]) { 阅读全文
posted @ 2020-02-06 10:07 bobo哥 阅读(167) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 54 下一页