import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scr = new Scanner(System.in); int N = scr.nextInt(); int[] A=new int[N]; int[] B=new int[N]; int[] C=new int[N]; scr.nextLine(); String Line=scr.nextLine(); for(int j=0;j<N;j++) { A[j]=Integer.parseInt(Line.split(" ")[j]); } Line=scr.nextLine(); for(int j=0;j<N;j++) { B[j]=Integer.parseInt(Line.split(" ")[j]); } Line=scr.nextLine(); for(int j=0;j<N;j++) { C[j]=Integer.parseInt(Line.split(" ")[j]); } //枚举所有三元组组合 int res=0; for(int i=0;i<N;i++) { for(int j=0;j<N;j++) { for(int k=0;k<N;k++) { if(A[i]<B[j]&&B[j]<C[k]) {//判断是否满足条件 res++; } } } } System.out.print(res); } }
解题思路:
注意事项:
参考代码:
0.0分
0 人评分
ASCII帮了大忙浏览:749 |
简单的a+b (C语言代码)浏览:573 |
WU-复数求和 (C++代码)浏览:2015 |
2004年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:1341 |
最小公倍数 (C语言代码)浏览:1029 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:403 |
C语言训练-8除不尽的数 (C语言代码)浏览:1402 |
C语言程序设计教程(第三版)课后习题9.1 (C语言代码)浏览:568 |
C语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:771 |
简单的a+b (C语言代码)浏览:466 |