1.結果顯示
-Configuration: --------------------
man
Process completed. 編譯成功 以下為程式碼
public class yr20130725
{
public static void main(String[] args)
{
int u=30;
if (u
System.out.println("young man");
else if(u
System.out.println(" man");
else if(u
System.out.println("old man");
}
}
2.--------------------Configuration:
young man
Process completed.編譯成功
//use if-else
public class yr20130725_01
{
public static void main(String[] args)
{
int u=30;
if (u>90)
System.out.println("older man");
else if(u>40)
System.out.println("man");
else if(u>20)
System.out.println("young man");
else if(u
System.out.println("young boy");
}
}
- Jul 25 Thu 2013 16:15
關於if-else的連續使用去判斷 2個簡短程式碼
close
全站熱搜
留言列表
發表留言