public static void main(String[] args) { int n; System.out.print("输入n:"); n = new Scanner(System.in).nextInt(); System.out.printf("2n = %d%n", 2 * n); if (n >= 0 && n < 31) { System.out.printf("2^%d = %s%n", n, Math.pow(2, ...
(7)、利用公式e=1+1/1!+1/2!+1/3!+……+1/n!,编程序求e的近似值,直到第n项(1/n!)<10的负6次方。 答案1 #includevoid main(){ float x,y; scanf("%f",&x); if(x>1) y=x; if(x>=1&&x<6) y=3*x-2; if(x>=6) y=4*x-8; printf("%f"...