摘要: 1 import java.util.Scanner; 2 3 public class InputException{ 4 public static void main(String[] args){ 5 Scanner input = new Scanner(System.in); 6 boolean a = true; 7 ... 阅读全文
posted @ 2016-08-05 12:13 白芍的 阅读(736) 评论(0) 推荐(0) 编辑
摘要: 新建一个数组,并交换它们的第a,b个数组元素。 正确的写法: int[] arr = new int[10]; int temp = arr[a]; arr[a] = arr[b]; arr[b] = temp; 另一种错误的写法(我一开始的想法): int temp = a; a = b; b = 阅读全文
posted @ 2016-08-04 10:47 白芍的 阅读(1492) 评论(0) 推荐(0) 编辑