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/06 11:36:40
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

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