📄 area.java
字号:
/*
* Created on 2003/12/16
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
* @author zhaoz
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class area {
public static void main(String args[]){
double pi,r,a,c,d;
r=10.8;
pi=3.1416;
a=pi*r*r;
c=3.0;
d=4.0;
System.out.println("area of circle: " + a);
char ch1,ch2;
ch1=88;
ch2='Y';
System.out.println("ch1 and ch2 " + ch1 + " " + ch2);
ch1='X';
System.out.println("ch1 " + ch1);
ch1++;
System.out.println("ch1 now " + ch1);
ch1='\123';
System.out.println("ch1 now " + ch1);
ch1='\u3540';
System.out.println("ch1 now " + ch1);
ch1='\r';
System.out.println("ch1 now " + ch1);
ch1='\t';
System.out.println("ch1 now " + (int)ch1);
ch1='\b';
System.out.println("ch1 now " + (int)ch1);
ch1='\f';
System.out.println("ch1 now " + (int)ch1);
a=Math.sqrt(c*c+d*d);
System.out.println("a now " + a);
int e=257;
byte f;
f=(byte)e;
System.out.println("f now " + f);
e=10000%256;
System.out.println("e now " + e);
f=(byte)pi;
System.out.println("pi now " + f);
byte aa,bb,cc;
aa=125;
bb=125;
cc=100;
e=aa*bb*cc;
System.out.println("e now " + e);
aa=50;
aa=(byte)(aa*2);
System.out.println("aa now " + aa);
int[][] twoD;
twoD=new int[4][];
for(int i=0;i<4;i++){
twoD[i]=new int[i+1];
}
int i,j,k=1;
for(i=0;i<4;i++){
for(j=0;j<i+1;j++){
twoD[i][j]=k;
k++;
}
}
for(i=0;i<4;i++){
for(j=0;j<i+1;j++){
System.out.print(twoD[i][j] + " ");
}
System.out.println();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -