⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oldmac1.cpp

📁 C++&datastructure书籍源码,以前外教提供现在与大家共享
💻 CPP
字号:
#include <iostream>#include <string>using namespace std;// working version of old macdonald, single parameter proceduresvoid EiEio(){    cout << "Ee-igh, Ee-igh, oh!" << endl;}void Refrain(){    cout << "Old MacDonald had a farm, ";    EiEio();}void HadA(string animal){    cout << "And on his farm he had a " << animal << ", ";    EiEio();}void WithA(string noise)// the principal part of a verse{    cout << "With a " << noise << " " << noise << " here" << endl;    cout << "And a " << noise << " " << noise << " there" << endl;    cout << "Here a " << noise << ", "          << "there a " << noise << ", "         << " everywhere a " << noise << " " << noise << endl;}void Pig(){    Refrain();    HadA("pig");    WithA("oink");    Refrain();}void Cow(){    Refrain();    HadA("cow");    WithA("moo");    Refrain();}int main(){    Cow();    cout << endl;    Pig();    return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -