c++ sqrt 用函数Given natural number n.Calculate the expression shown on image using functions Example:Input:1 Output:1.41421 Example:Input:2 Output:1.84776

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/28 11:33:20
c++sqrt用函数Givennaturalnumbern.CalculatetheexpressionshownonimageusingfunctionsExample:Input:1Output:

c++ sqrt 用函数Given natural number n.Calculate the expression shown on image using functions Example:Input:1 Output:1.41421 Example:Input:2 Output:1.84776
c++ sqrt 用函数
Given natural number n.Calculate the expression shown on image using functions
Example:
Input:
1
Output:
1.41421
Example:
Input:
2
Output:
1.84776

c++ sqrt 用函数Given natural number n.Calculate the expression shown on image using functions Example:Input:1 Output:1.41421 Example:Input:2 Output:1.84776
#include
#include
using namespace std;
int main ()
{
int n=1;
int i;
double r=0;
cout > n;
for (i=1;i