关于C++的两个问题.

来源:百度知道 编辑:UC知道 时间:2024/06/17 05:11:14
1,编写一个完整的包含输入和输出的简单C++程序
2,利用函数重载,重载函数2X2+4X+5,X为浮点数,谢谢

1. #include <iostream>

using std::cin;
using std::cout;
using std::endl;

int main()
{
int i;
cin >> i;
cout << endl << i << endl;

return 0;
}

2. int calc(int x)
{
return 2 * 2 + 4 * x + 5;
}

float calc(float x)
{
return 2 * 2 + 4 * x + 5;
}

第二个问题说的不是很清楚啊。