public class HelloWorld {
public static void main(String[] args) {
int age=25;
if(age > 60){
System.out.println("老年");
}else if( age > 18){
System.out.println("少年");
}else{
System.out.println("童年");
}
}
}
public static void main(String[] args) {
int age=25;
if(age > 60){
System.out.println("老年");
}else if( age > 18){
System.out.println("少年");
}else{
System.out.println("童年");
}
}
}
2015-08-27
public class HelloWorld {
public static void main(String[] args) {
int age=25;
if(age > 18){
System.out.println("成年");
}else {
System.out.println("未成年");
}
}
}
public static void main(String[] args) {
int age=25;
if(age > 18){
System.out.println("成年");
}else {
System.out.println("未成年");
}
}
}
2015-08-27
public class HelloWorld {
public static void main(String[] args) {
int one = 20 ;
if(one /2 == 0){
System.out.println(one + "是偶数");
}
}
}
public static void main(String[] args) {
int one = 20 ;
if(one /2 == 0){
System.out.println(one + "是偶数");
}
}
}
2015-08-27
System.out.println("打印直角三角形");
for (int i = 1;i<=3;i++) {
for (int j = 1; j<=i;j++) {
System.out.print("*");
}
System.out.println();
for (int i = 1;i<=3;i++) {
for (int j = 1; j<=i;j++) {
System.out.print("*");
}
System.out.println();
2015-08-27