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 人评分
母牛的故事 (C语言代码)浏览:435 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:665 |
输出正反三角形 (C语言代码)浏览:782 |
校门外的树 (C语言代码)浏览:956 |
【求[X,Y]内被除3余1并且被除5余3的整数的和】 (C语言代码)浏览:673 |
sizeof的大作用 (C语言代码)浏览:1449 |
C语言程序设计教程(第三版)课后习题10.7 (用指针求解)浏览:1462 |
三角形 (C语言代码)浏览:653 |
简单的a+b (C语言代码)浏览:557 |
求圆的面积 (C++代码)浮点数有误差!!!浏览:671 |