qingan
2018-09-12 20:00
{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
three=one+two;
System.out.println("three=one+two==>"+three);
three+=one;
System.out.println("three+=one==>"+three);
three-=one;
System.out.println("three-=one==>"+three);
three*=one;
System.out.println("three*=one==>"+three);
three/=one;
System.out.println("three/=one==>"+three);
three%=one;
System.out.println("three%=one==>"+three);
}
}
three=one+two;
three%=one;
这两处的分号你用的中文格式。
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
three=one+two;//在此处three的值已经是20了
System.out.println("three=one+two==>"+three);
three+=one; //three的值变成了30
System.out.println("three+=one==>"+three);
three-=one;
System.out.println("three-=one==>"+three);
three*=one;
System.out.println("three*=one==>"+three);
three/=one;
System.out.println("three/=one==>"+three);
three%=one;
System.out.println("three%=one==>"+three);
}
}
Java入门第一季(IDEA工具)升级版
1165559 学习 · 17587 问题
相似问题