[C++] 有关程序员的笑话
2011-02-14 13:09
302 查看
老婆给当程序员的老公打电话:“下班顺路买一斤包子带回来,如果看到卖西瓜的,就买一个。”当晚,程序员老公手捧一个包子进了家门……老婆怒道:“你怎么就买了一个包子?!”老公答曰:“因为看到了卖西瓜的。”
我承认我很闲....=.=
我承认我很闲....=.=
#include<iostream> #include<string> using namespace std; class Bun { private: int m_num; string m_unit; public: Bun(){} Bun(int num,string unit) { ChangeBun(num,unit); } void PrintBun() { cout<<"buy bun "<<m_num<<" "; cout<<m_unit<<endl; } void ChangeBun(int num,string unit) { m_num = num; m_unit = unit; } }; bool IsFoundWatermelonStall() { cout<<"看到賣西瓜的了"<<endl; return true; } int main() { cout<<"去買一斤包子,看到賣西瓜的,就買一個"<<endl; Bun* bun = new Bun(1,"斤"); bun->PrintBun(); if(IsFoundWatermelonStall()) bun->ChangeBun(1,"個"); bun->PrintBun(); delete bun; system("pause"); return 0; }
相关文章推荐
- 有关程序员的笑话
- 有关程序员的笑话1
- 吐槽一篇...有关C++程序员的基本素质
- 有关程序员的51个笑话
- 用于测试C++/C程序员的基本编程技能、编程质量以及对C++/C的理解程度的一份考卷试题
- C++程序员的阅读清单
- 热乎乎的程序员笑话:
- 有关C++
- c++程序员对于java的误区之数据结构
- C/C++ Linux 程序员必须了解的 10 个工具
- [随想]C/C++程序员
- 编码的法则:c++程序员不可不知的101条经验
- C/C++程序员必须熟练应用的开源项目
- C++程序员经常问的11个问题
- C++程序员必需的修养
- 如何成为一个C++高级程序员
- 有关C/C++指针的经典面试题(转)
- c++ 基础知识浅谈之四---时钟,循环,cin文件结束符有关
- c++之路进阶——斜率优化形如DP[i]=f[j]+x[i](f[j]只与j变量有关)的问题(Print Article)
- 公司技术管理角度看C++游戏程序员发展