- class Test
- {
- public static void main(String[] args)
- {
- int i1 = 10;
- int i2 = 10;
- System.out.println("i1 + i2 = " + (i1 + i2));
- System.out.println("i1 - i2 = " + (i1 - i2));
- System.out.println("i1 * i2 = " + (i1 * i2));
- System.out.println("i1 / i2 = " + (i1 / i2));
- }
- }
- 你没加括号都变成字符串了,而—不能识别。所以要都要加上括号,
复制代码 |