编写一个函数急!求各位大神帮忙
实现数列一加二分之一加三分之一.........的求和功能知道通项小于一万分之一编写完成该函数体并在主函数中调用该函数
慕运维8527718
浏览 1363回答 3
3回答
-
慕的地8582982
DTJCPVJIPSSTZVAWNGDMOBDTPSGUDJMZOOZJZJZLCVLSHGWMTNGGNMTGBVXGAJJZJMHQPKXWDYEHRCFZDXQJQQZMMISMZVFBYBLVXQAJWTCJJUPYTTQAKKDXKZFFAWHFBAHHSIEHEHHLBTGACMZZXEUXXTDDMGMIWYUHBGLIWSPFSFCVSSERLVLIEOHSKQVMFDOHREPPYBRRHMUUUZSFYMWOFLPPONWANXJZDMCXNGJAGUXXDXWJSJCMVZCOKXWNQQNZPPKDFZVIEEFJMJMVZFSVCZZFKKQTDMPTZKWQDQKEUCRAQXEXDNGZOUVWAWQAAGGPZZCCFRVLEBEHRRHAMJLFZYEHNHRNTZNANYLSBVGSOURRICFDQTGDTMZPDAATGFIBXVOVIYRJGCYLOIZBBOXHHXERVXYRBYMERQNQUDGKNADPTQQYHXBYJEPAILOOKXHAOKDNGDUKUDYEEYVBTJWFMBKDXGLVJTNJNJJMTRHZICIAXTGQXIITWTVMJQWNDXUHNUQGIESWMSNQTZJMJODKKOAMWIIVFJQZNAIQZTJGAOLHBEJPCAKQWZGZHXDXAWFMFYFRLMPPFLLILSYHTNGQNHGSPQVSSAUYHYRESFOISABLOVUJSMFSTTCIMPMZYEBLRKUXHWSDAEKXQQJGKQCJXKUBKWMJSHRNLJMPDZDFIRHYBXADASHYHRNQAQTJDIPWHAKEBVRXDDOFVPIFPSJYNQHRHDGPTGVZCLVLQMAKUWSIFBRBEHPJYUVYBRORAQTJFPFPGYZTMGWCADHXQWQRDUNXLFYEKEYDMWDCFFVBFRPVJWGEHBJCCOAMJSPSVLNQPZZJXQQCMGRSOHYIMBVSMPAGJDWJWPFIFNGZTPUGJJWT
-
望远
double function()
{
double sum=0,temp=0;
int i;
for(i=1;i<=10000;i++)
{
temp=1/i;
sum+=temp;
}
return sum;
}
-
进阶白发
intfunction getSum(){sum = 0;for(var i=1; i<1000;i++){sum = sum + 1/i;}}
-
咕咕问
function getSum(){sum = 0;for(var i=1; i<1000;i++){sum = sum + 1/i;}}
打开App,查看更多内容