cpp学习笔记03
由于时效问题,该文某些代码、技术可能已经过期,请注意!!!本文最后更新于:3 年前
如题
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| #include<iostream> #include<string> using namespace std;
const double pi = 3.14;
class C1 { int m1; };
struct C2 { int m2; };
class Circle { public: int r;
double calculate() { return 2 * pi * r; }
protected: int r1;
private: int r2; };
int main(int argc, char const *argv[]) { Circle c1; c1.r = 10;
cout << c1.calculate() << endl;
return 0; }
|