?? test2.java
字號:
public class test2
{
public static void main(String []args)
{
int x=5,y;
float f1,f2;
y=x/2;
f1=x/2;
f2=(float)x/2;
System.out.println(5%2);
System.out.println(-5%2);
System.out.println(5%-2);
System.out.println(y);
System.out.println(f1);
System.out.println(f2);
int z=2;
z=(z+5)/6;//有z個人,每個房間可以住6人,求安排z個人住宿所需要的房間數(也可用于分頁顯示數據)
System.out.println(z);
/*int b=0;
while(true)
{
b=(b+1)%10;//打印產生在0到9之間循環變化的數字
System.out.println(b);
}*/
int x1=0x80000000;
int y1=x1>>1;
System.out.println(Integer.toHexString(y1));
int y2=x1>>>1;
System.out.println(Integer.toHexString(y2));
int a =2;
int b= (a ++)+ 3 * a;
System.out.println(b);//結果11
int c =2;
int d= c + 3 * c++;
System.out.println(d);/結果8
}
}
//輸出結果:
//1
//-1
//1
//2
//2.0
//2.5
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -