weixin_慕斯7292930WD
2020-01-23 09:27
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
three=one+two;
int a=three+=one;
int b=three-=one;
int c=three*=one;
int d=three/=one;
int e=three%=one;
System.out.printlin("three=one+two"==>+three);
System.out.printlin("three+=one"==>+a);
System.out.printlin("three-=one"==>+b);
System.out.printlin("three*=one"==>+c);
System.out.printlin("three/=one"==>+d);
System.out.printlin("three%=one"==>+e);
一共两个问题,给你用单行注释标记了
public class HelloWorld{ public static void main(String[] args) { int one = 10 ; int two = 20 ; int three = 0 ; three=one+two; int a=three+=one; int b=three-=one; int c=three*=one; int d=three/=one; int e=three%=one; //你的所有System.out.println都错写为System.out.printlin了 System.out.println("three=one+two ==>"+three); //题目里 ==> 是要打印的内容 System.out.println("three+=one ==>"+a); System.out.println("three-=one ==>"+b); System.out.println("three*=one ==>"+c); System.out.println("three/=one ==>"+d); System.out.println("three%=one ==>"+e); } }
我的是这样
public class HelloWorld{
public static void main(String[] args) {
int one = 10 ;
int two = 20 ;
int three = 0 ;
int a=three=one+two;
int b=three+=one;
int c=three-=one;
int d=three*=one;
int e=three/=one;
int f=three%=one;
System.out.println("three = one +two==>"+a);
System.out.println("three +=one==>"+b);
System.out.println("three -=one==>"+c);
System.out.println("three *=one==>"+d);
System.out.println("three /=one==>"+e);
System.out.println("three %=one==>"+f);
int three =
0
; 这个要去掉
Java入门第一季(IDEA工具)升级版
1165551 学习 · 17586 问题
相似问题