#include<stdio.h>
int main(){
int i,n;
scanf("%d",&n);
float sum=0.0;
float a=;
float b=;
for(i=;i<=n;i++){
sum=sum+1.0*b/a;
int c=a;
a=b;
b=c+b;
}
printf("s=%.2f\n", sum);
return ;
}

Problem H: 计算数列和2/1,3/2,5/3,8/5......的更多相关文章

  1. 实验12:Problem H: 整型数组运算符重载

    Home Web Board ProblemSet Standing Status Statistics   Problem H: 整型数组运算符重载 Problem H: 整型数组运算符重载 Tim ...

  2. The Ninth Hunan Collegiate Programming Contest (2013) Problem H

    Problem H High bridge, low bridge Q: There are one high bridge and one low bridge across the river. ...

  3. Gym 100531H Problem H. Hiking in the Hills 二分

    Problem H. Hiking in the Hills 题目连接: http://codeforces.com/gym/100531/attachments Description Helen ...

  4. Codeforces Gym 100610 Problem H. Horrible Truth 瞎搞

    Problem H. Horrible Truth Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/1006 ...

  5. Codeforces Gym 100342H Problem H. Hard Test 构造题,卡迪杰斯特拉

    Problem H. Hard TestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/at ...

  6. 清北学堂入学测试P4751 H’s problem(h)

    P4751 H’s problem(h)  时间: 1000ms / 空间: 655360KiB / Java类名: Main 背景 冬令营入学测试 描述 小H是一个喜欢逛街的女孩子,但是由于上了大学 ...

  7. Problem H

    Problem Description 穿过幽谷意味着离大魔王lemon已经无限接近了! 可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个 ...

  8. 2013-2014 ACM-ICPC, NEERC, Southern Subregional Contest Problem H. Password Service dp

    Problem H. Password Service 题目连接: http://www.codeforces.com/gym/100253 Description Startups are here ...

  9. Western Subregional of NEERC, Minsk, Wednesday, November 4, 2015 Problem H. Parallel Worlds 计算几何

    Problem H. Parallel Worlds 题目连接: http://opentrains.snarknews.info/~ejudge/team.cgi?SID=c75360ed7f2c7 ...

随机推荐

  1. Drupal7导入语言包

    下载语言包 然后把包存放在profiles\standard\translations目录下,安装. 如果出现如下错误 1.错误有MySql数据库默认引擎innoDB引起,只要mysql\bin\my ...

  2. 用 letsencrypt 生成 SSL 证书

    letsencrypt 生成 SSL 证书 事先配置好访问域名解析 在nginx 对应虚拟主机添加一个验证区域: 配置 nginx server { listen 80; ... location ~ ...

  3. 【洛谷 P1896】[SCOI2005]互不侵犯(状压dp)

    题目链接 题意:在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案.国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个格子. 这是道状压\(DP\)好题啊.. ...

  4. linux中nginx重定向方法总结

    linux中nginx 301重定向跳转方法总结 第一种情况:访问aaaaaaa站定向到bbbbbbbbbbb站 复制代码代码如下: server { server_naaaaaaame www.aa ...

  5. ie8以上及非ie8情况下的写法

    <!-- [if gt ie 8]> <!--> <script src="no-ie8.js"></script>  <!- ...

  6. 【bzoj2242】计算器

    #include<bits/stdc++.h> #define inf 1000000000 using namespace std; typedef long long ll; ?a:g ...

  7. Storm中log4j日志打印不出来的解决办法

    使用storm命令启动JAVA进程的时候,发现log4j日志打印不出来,咋办呢? 解决办法如下(亲测): 删除strom/lib目录下的log4j-over-slf4j-1.6.6.jar strom ...

  8. SPOJ - AMR11H

    Array Diversity Time Limit: 404MS   Memory Limit: 1572864KB   64bit IO Format: %lld & %llu Submi ...

  9. times、 time、clock函数说明

    sysconf( _SC_CLK_TCK )  功能  获取系统的 时钟滴答的频率. clock_gettime() clock()返回的是各个线程运行cpu时间的和, 返回值一直都是0. 定义函数: ...

  10. 使用 mybatis和oracle 数据库出现的问题

    mybatis 官网教程 http://www.mybatis.org/mybatis-3/zh/dynamic-sql.html 出现 Could not set parameters for ma ...