代码中使用字符串输出值,连接符是+号,“=”是赋值,代码会报错的。想实现和知否大于20
int total = a + b + c + d; Sysout.out.println("和为:" + total); Sysout.out.println(total > 20 );
15行,=x写成+x,你这是字符串拼接输出,不是赋值
你最后一行打印改成下面的就可以了,你copy过去在运行一下试一下:
Sysout.out.println("4位会员卡号之和 = " + x);