实例 C++ 多次调用函数

x
 
#include <iostream>
using namespace std;
void myFunction() {
  cout << "I just got executed!\n";
}
int main() {
  myFunction();
  myFunction();
  myFunction();
  return 0;
}
                    

输出结果

I just got executed!
I just got executed!
I just got executed!