解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()){ int sum=0; int n = sc.nextInt(); int[]a = new int[n]; for (int i = 0; i < n; i++) { a[i]=sc.nextInt(); sum+=Math.abs(a[i]); } System.out.println(sum); } } }
0.0分
1 人评分
简单的a+b (C语言代码)浏览:524 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:538 |
WU-拆分位数 (C++代码)浏览:779 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:784 |
字符逆序 (C语言代码)浏览:612 |
简单的a+b (C语言代码)浏览:580 |
1199题解浏览:653 |
哥德巴赫曾猜测 (C语言代码)浏览:714 |
C语言程序设计教程(第三版)课后习题7.3 (C++代码)浏览:457 |
素数的个数 一直是超时浏览:666 |