标签:col span oid pre 休闲 pac str style clu
一个类就只做一件事情。
1 #define _CRT_SECURE_NO_WARNINGS 2 #include <iostream> 3 4 using namespace std; 5 6 7 #if 0 8 class Clothes 9 { 10 public: 11 void shopping() { 12 cout << "休闲的服装" << endl; 13 } 14 void working() { 15 cout << "休闲的服装" << endl; 16 } 17 }; 18 #endif 19 20 class ClothesShpping 21 { 22 public: 23 void style() { 24 cout << "休闲的服装" << endl; 25 } 26 }; 27 class ClothesWorking 28 { 29 public: 30 void style() { 31 cout << "休闲的服装" << endl; 32 } 33 }; 34 35 int main(void) 36 { 37 #if 0 38 Clothes c1; 39 c1.shopping(); 40 41 c1.shopping(); 42 #endif 43 ClothesShpping cs; 44 cs.style(); 45 46 ClothesWorking cw; 47 cw.style(); 48 49 return 0; 50 }
标签:col span oid pre 休闲 pac str style clu
原文地址:https://www.cnblogs.com/strangemonkey/p/12544111.html