herrDeng網內搜尋

自訂搜尋

Ads

2011年4月28日 星期四

期中1

13 則留言:

B9933066 提到...

import java.util.*;
public class SwitchCase {
public static void main(String[] args) throws Exception{
Scanner input=new Scanner(System.in);
int x;
{
System.out.println("請輸入數字");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");
break;
default:
System.out.println("錯誤");
}
}
}
}

B9933073 提到...

import java.util.*;
public class ba{
public static void main (String args[])throws Exception
{
Scanner input = new Scanner(System.in);
int x ;
do{System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");
break;
default:
System.out.println("不存在");
}
}while(x!=0);
}

}

B9933067 提到...

import java.util.*;
public class W{
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

B9833034 提到...

import java.util.*;
public class qq
{public static void main(String[]args) throws Exception
{Scanner input=new Scanner(System.in);
int x;
do{
System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");
break;
default:
System.out.println("沒有這個數字");
}
}while (x!=0);
}
}

我好帥 提到...

import java.util.*;
public class XX{
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

B9933072 提到...

import java.util.*;
public class s {
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

B9933072 提到...

import java.util.*;
public class s {
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}




import java.util.*;
public class s {
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

B9933072 提到...

import java.util.*;
public class s {
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

B9933072 提到...

import java.util.*;
public class s {
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

B9933072 提到...

import java.util.*;
public class s {
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

b9933093 提到...

import java.util.*;
public class switchcase
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
int x;
do{
System.out.print("x=");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");
break;
default:
System.out.println("錯誤");
}
}while(x!=0);
}
}

B9933075 提到...

import java.util.*;
public class SC {
public static void main(String[] args) throws Exception{
Scanner input=new Scanner(System.in);
int x;
{
System.out.println("請輸入數字");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");
break;
default:
System.out.println("錯誤");
}
}
}
}

B9933070 提到...

import java.util.*;
public class XX{
public static void main(String[] args) throws Exception
{ Scanner input=new Scanner(System.in);
int x ;
do{ System.out.println("輸入星期幾");
x=input.nextInt();
switch(x){
case 1:
System.out.println("星期一");
break;
case 2:
System.out.println("星期二");
break;
case 3:
System.out.println("星期三");
break;
case 4:
System.out.println("星期四");
break;
case 5:
System.out.println("星期五");
break;
case 6:
System.out.println("星期六");
break;
case 7:
System.out.println("星期日");

break;
default:
System.out.println("沒有這個數字");

}
}while (x!=0);

}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章