Java取模操作

2019年2月11日23:03:52 发表评论 912 views
/**
 * Created by xabcd on 2019/2/11.
 */
public class TestJava3_16
{public static void main(String args[])
{
    int a = 5;
    int b = 3;
    System.out.println(a+"%"+b+"="+(a%b));
    System.out.println(b+"%"+a+"="+(b%a));

}
}







5%3=2
3%5=3

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: