解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double n = scanner.nextDouble(); double m=0; int sum=0; for(int i =0;i<n;i++) { double b = scanner.nextDouble(); sum += b; } m = sum/n; System.out.println(sum+" "+String.format("%.5f",m)); } }
0.0分
2 人评分