62,614
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
int i=0xffd0;
short s;
if (i>0x7fff) {
s=(short)-(i-0x8000);
} else {
s=(short)i;
}
System.out.println(s);
}
public static void main(String[] args) {
int i=0xffd0;
int s;
if (i>0x7fff) {
s=-(i-0x8000);
} else {
s=i;
}
System.out.println(s);
}