标签:
无聊,刷水题练下java
import java.util.*; public class Main { public static void main(String[] args){ Scanner cin=new Scanner(System.in); double n; int m; while(cin.hasNext()) { n=cin.nextDouble(); m=cin.nextInt(); double sum=n; for(int i=0;i<m-1;i++) { sum+=Math.sqrt(n); n=Math.sqrt(n); } System.out.printf("%.2f",sum); System.out.println(); } } }
标签:
原文地址:http://blog.csdn.net/zafkiel_nightmare/article/details/45560613