ourfunc.cpp

来自「一本很好的C++学习的丛书!初学者必看的」· C++ 代码 · 共 22 行

CPP
22
字号
// ourfunc.cpp -- defining your own function#include <iostream>void simon(int);    // function prototype for simon()int main(){    using namespace std;    simon(3);       // call the simon() function    cout << "Pick an integer: ";    int count;    cin >> count;    simon(count);   // call it again    cout << "Done!" << endl;    return 0;}void simon(int n)   // define the simon() function{    using namespace std;    cout << "Simon says touch your toes " << n << " times." << endl;}                   // void functions don't need return statements

⌨️ 快捷键说明

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