import java.text.DecimalFormat; import java.util.Scanner; /** * Created by feyman1120 on 2017/11/23. */ public class Main { public static void main(String [] args){ Scanner scan = new Scanner(System.in); while (scan.hasNext()){ int m = scan.nextInt(); int n = scan.nextInt(); double sum = 0; double x = m; for (int i = 0; i < n; ++i){ sum += x; x = Math.sqrt(x); } DecimalFormat df = new DecimalFormat("#0.00"); System.out.println(df.format(sum)); } } }
hdu_2009 求数列的和
最新推荐文章于 2019-02-15 15:31:11 发布