Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

金浩 #39

Open
shencang opened this issue Nov 5, 2016 · 0 comments
Open

金浩 #39

shencang opened this issue Nov 5, 2016 · 0 comments

Comments

@shencang
Copy link

shencang commented Nov 5, 2016

数列求和

#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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant