平方根函數的使用
#include<iostream>
using namespace std;
int Sum_Nature(int,int);
int main()
{
int s{ 0 }, n{ 0 };
int sum{ 0 };
cout << "請分別輸入自然數起始數和總自然數個數: ";
cin >> s>>n;
sum = Sum_Nature(s, n);
cout << "從"<<s<<"開始的"<<n<<"個自然數的和爲:"<<sum<<endl;
}
int Sum_Nature(int s, int n)
{
int i, sum{0};
for (i = s; i < s+n; i++)
sum = sum+i;
return sum;
}
```## 函數概述
![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200214231136199.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1BhdWxfWVE=,size_16,color_FFFFFF,t_70)
![在這裏插入圖片描述](https://img-blog.csdnimg.cn/2020021423122178.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1BhdWxfWVE=,size_16,color_FFFFFF,t_70)
## 函數的分類
![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200214231306119.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1BhdWxfWVE=,size_16,color_FFFFFF,t_70)
![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200214231645240.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1BhdWxfWVE=,size_16,color_FFFFFF,t_70)
![在這裏插入圖片描述](https://img-blog.csdnimg.cn/20200214232029677.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1BhdWxfWVE=,size_16,color_FFFFFF,t_70)