题目描述
代码实现
package com.atguigu.lanqiao;import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int n = sc.nextInt();int k = sc.nextInt();int[] array = new int[n];for (int i = 0; i < n; i++) {array[i] = sc.nextInt();}int answer = 0;for (int i = 0; i < n; i++) {for (int j = 0; j < n; j++) {String temp = array[i] + "" + array[j];Integer sum = Integer.valueOf(temp);if (i != j && sum <= k) {answer++;}}}System.out.println(answer);}}