c++自定义函数

来源:互联网 发布:mac os 10.13.1黑苹果 编辑:程序博客网 时间:2024/06/12 23:21
#include <iostream>
#include <cmath>
using namespace std;
void test(int);//定义一个无返回值的函数test原型 参数类型为int
int main() {
int count;
cout << "请输入一个整数" << endl;
cin >> count;
test(count);
return 0;
}
//test函数源代码
void test(int n){
cout << "你输入的数字是:" << n << endl;
}
0 0
原创粉丝点击