#define _CRT_SECURE_NO_DEPRECATE //兼容C的标准格式
#include<iostream>
//1.c++函数模块
using namespace std;
void print(int times);
int main()
{
print(3);
system("pause");
}
//注:避免使用cout,应该使用std::cout.便于在其他地方仍然可以使用
void print(int times)
{
for (int i = 0; i < times; i++)
{
std::cout << "print " << i + 1 << " times" << endl;
std::cout << "hello world"<<endl;
}
std::cout << endl;
}
10 C++函数编写注意事项
最新推荐文章于 2022-11-23 16:40:51 发布