刚刚编辑了代码:
String id = "9506265088085";int[] intArray = new int[id.length()];int sum = 0;for (int i = 0; i < intArray.length; i++) { if (i%2!=0) { sum += Integer.parseInt(String.valueOf(id.charAt(i)); }} System.out.println(sum);
欢迎分享,转载请注明来源:内存溢出
刚刚编辑了代码:
String id = "9506265088085";int[] intArray = new int[id.length()];int sum = 0;for (int i = 0; i < intArray.length; i++) { if (i%2!=0) { sum += Integer.parseInt(String.valueOf(id.charAt(i)); }} System.out.println(sum);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)