#include<sdtio.h>
double fun(int n)
{
double m = 1.0, p = 1.0;
int i;
//方法二/*for (i = 1; i <= n; i++)
{
p = p * i;
m = m + 1.0 / p;
}*/
//方法一
for (i = 1; i <= n; i++)
{
p = 1.0;
for (int j = 1; j <= i; j++)
{
p = p * i;
}
m = m + 1.0 / p;
}
return m;
}
main()
{
while (1)
{
int n = 0;
double s = 0.0;
printf("Input n: ");
scanf_s("%d", &n);
s = fun(n);
printf("s=%f\n", s);
printf("\n");
}
}
变电站设备检测检测系统源码分享
[一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示]
1.研究背景与意义
项目参考AAAI Association for the Advancement of Artificial Intelligence
项目来源AACV Association for the Advancement of Computer V…