3 回答
已采纳
XhstormR
TA贡献140条经验 获得超197个赞
public class Test { public static void main(String[] args) { int a = 24; int b = 18; int c = 36; int d = 27; int i = (a + b + c + d) / 4; System.out.println(i); } }
代码以上,不懂再问啊,望采纳。
qq_慕妹5056700
TA贡献6条经验 获得超1个赞
public class Test {
public static void main(String[] args) {
int a = 24;
int b = 18;
int c = 36;
int d = 27;
Double i = (a + b + c + d) / 4; (最好用double 这样如果不能整除 也会显示出小数点后的数)
System.out.println(i);
}
}
添加回答
举报
0/150
提交
取消