Skip to content

金浩 #39

@shencang

Description

@shencang

数列求和

#include<stdio.h>
int main()
{
    int a,b,c,i;
    float s;//循环变量 
    a=1;b=2;
    for(i=1;i<=20;i++)
    {
        s=s+1.0*b/a;//谜之不懂这里加了括号就成保留整数// 
        c=a;
        a=b;
        b=c+b;
    }
    printf("%.16f",s);//计算结果// 
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions