解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Dome19 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { int n = scanner.nextInt(); int[][] arr = new int[n][2]; for (int i = 0; i < n; i++) { arr[i][0] = scanner.nextInt(); arr[i][1] = scanner.nextInt(); } for (int i = 0; i < n; i++) { int a = 0, b = 0; int num=Math.max(arr[i][0], arr[i][1]) / 2; for (int j = 1; j <= num; j++) { if (arr[i][0] % j == 0) a += j; if (arr[i][1] % j == 0) b += j; } System.out.println(a == arr[i][1] && b == arr[i][0] ? "YES" : "NO"); a = 0; b = 0; } } } }
0.0分
1 人评分
DNA (C语言描述,蓝桥杯)浏览:1653 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:645 |
A+B for Input-Output Practice (VI) (C语言代码)浏览:575 |
1035 题解浏览:875 |
一元一次方程 (C语言代码)浏览:4248 |
字符串比较 (C语言代码)浏览:770 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:416 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:609 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:820 |
青年歌手大奖赛_评委会打分 (C语言代码)浏览:2248 |