public class Test {
public static void main(String[] args) {
int m=0;
Scanner si =new Scanner(System.in);
String s1 = si.nextLine();
int n = Integer.parseInt(s1);
Scanner sii =new Scanner(System.in);
String s2 = sii.nextLine();
String[] sn = s2.split(" ");
for(int i=0;i<sn.length; i++) {
if (i==sn.length) break;
for (int j=i+1; j < sn.length; j++) {
String mString = sn[i]+sn[j];
String nString = sn[j]+sn[i];
int mm = Integer.parseInt(mString);
int nn = Integer.parseInt(nString);
if (mm%7==0) {
m++;
}
if (nn%7==0) {
m++;
}
}
}
System.out.println(m);
}
}
时间: 2024-12-30 02:59:03