import java.lang. *;
public class java03030701 {
public static void main (String [] args) {
remainder (12);
remainder (-7);
}
public static void remainder (int num) {
if (num% 3 == 0) {
System.out.println (num + " In addition to 3 , the remainder is 0 " ) ;
}
else if (num% 3 == 1) {
System.out.println (num + " In addition to 3 , the remainder is 1" ) ;
}
else {
assert num% 3 == 2: num + "% 3, the remainder non- 2" ;
System.out.println (num + " In addition to 3 , the remainder is 2" ) ;
}
}
}
the results shown in Figure
------ Solution ------- -------------------------------------
no way, to the sub- Results posted !
没有评论:
发表评论