标签:++ col 包含 index for code int [] style
//存放的是电话号码包含的数字 int[] nums = {4, 2, 1, 0, 8, 3}; //电话号码出现的下标 int[] index = {2, 4, 5, 2, 3, 0, 3, 2, 1, 0, 0}; //方式1 for (int i = 0; i < index.length; i++) { System.out.print(nums[index[i]]); } System.out.println(); //方式2 for (int a : index) { System.out.print(nums[a]); }
标签:++ col 包含 index for code int [] style
原文地址:https://www.cnblogs.com/liehuonanjue/p/9274485.html