![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
import java.math.BigInteger; import java.util.Scanner; public class Main {//类名要用Main public static void main(String[] args){ int T; BigInteger N,M; BigInteger MOD=new BigInteger("11"); BigInteger ZERO=new BigInteger("0"); Scanner sc=new Scanner(System.in); T=sc.nextInt(); while((T--)>0){ N=sc.nextBigInteger(); M=sc.nextBigInteger(); if(N.compareTo(M)==0&&N.mod(MOD).compareTo(ZERO)==0){// System.out.println("YES"); } else{// System.out.println("NO"); } } } }
ps:取余最好用remainder,mod好像mod负数报错