POJ1003

作者: Shiki | 来源:发表于2014-08-21 15:54 被阅读0次

问题描述###

无~


难点###

没有任何难度,水过~


代码实现###

package poj; import java.util.Scanner; public class Poj1003 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { double length = sc.nextDouble(); if(length == 0.0) break; double s = 0.0; int i; for(i = 2; ; i ++){ s+=(double)1/i; if(s>length) break; } System.out.println((i-1)+" card(s)"); } sc.close(); }

相关文章

  • POJ1003

    问题描述### 无~ 难点### 没有任何难度,水过~ 代码实现### package poj; import j...

网友评论

      本文标题:POJ1003

      本文链接:https://www.haomeiwen.com/subject/ssaetttx.html