public static void main(String args[]) { int a=9%4; int b=9%-4; int c=-9%4; int d=-9%-4; System.out.println(a); System.out.println(b); System.out.println(c); System.out.println(d);}
取余正负主要看除数的正负