求S=1+2+4+7+11+16……的值刚好大于等于5000时S的值。

发布时间:2019-08-07 02:06:02

是总和的值!!

推荐回答

C#程序:using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication35{    class Program    {        static void Main(string[] args)        {            double s = 1, i = 1, j = 1;            while (s < 5000)            {                j = j + i;                s = s + j;                i++;            }            Console.WriteLine(s-j);        }    }} 还没大于 5000时是 4991 大于5000的第一个数是 5488 最后一个加上的数是497                                                                                  Mr.wolf
以上问题属网友观点,不代表本站立场,仅供参考!