#include<iostream>
using namespace std;
void print(int i)
{
cout << "print an integer:" << endl;
}
void print(string str)
{
cout << "print a string :" << str << endl;
}
int main()
{
print(12);
print("hello world!");
return 0;
}
打印函数
最新推荐文章于 2025-09-28 23:04:56 发布
本文档展示了如何使用C++编写简单的函数print(),分别处理整数和字符串的输出。通过main函数调用这两个函数,演示了基本的数据类型和控制台输出操作。
4403

被折叠的 条评论
为什么被折叠?



