牛客编程巅峰赛S2赛季第四场
import java.util.*;
public class Solution {
/**
* 返回一个严格四舍五入保留两位小数的字符串
* @param n int整型 n
* @return string字符串
*/
public String Probability (int n) {
// write code here
double b = Math.pow(0.5,n)*2;
return String.format("%.2f", b);
}
}
#题解#
查看9道真题和解析