herrDeng網內搜尋

自訂搜尋

Ads

2012年5月23日 星期三

練習523a

一、 試利用switch case由程式中直接輸入一個1~7 之間的整數day,代表星期一到星期日。若day 的值是1,則印出 "星期一",若day 的值是2,則印出 "星期二",若day 的值是7,則印出 "星期日",若day 的值不是1~7,則印出 "不存在"。

50 則留言:

B10033015 提到...

import java.util.*;
public class test523 {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
x=input.nextInt();
//DAY
//一、 試利用switch case由程式中直接輸入一個1~7 之間的整數day,代表星期一到星期日。若day 的值是1,則印出 "星期一",若day 的值是2,則印出 "星期二",若day 的值是7,則印出 "星期日",若day 的值不是1~7,則印出 "不存在"。

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("不存在");
}
}
}

B10033003 提到...

import java.util.*;
public class test {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int ee=sc.nextInt();
switch(ee){
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("不存在");

}
}
}

B9833080 提到...

import java.util.*;
public class switch523_1 {

public static void main(String[] args) {
// B9833080 李貞儀
Scanner inpout=new Scanner(System.in);
int day =inpout.nextInt();
switch (day){
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("不存在");
}
}
}

B10033022 提到...

import java.util.*;
public class Hello523 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int 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("星期日");
default:
System.out.println("不存在");
}
}
}

B10033054 提到...

import java.util.*;
public class asd{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int x=sc.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("不存在");
}
}
}

B10033043 提到...

import java.util.*;
public class test {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
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("不存在");
}
}
}

B10033052 提到...

import java.util.*;
public class hello{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int i=input.nextInt();
switch(i)
{
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("不存在");
}
}
}

B10033016 提到...

public class b10033016{
// 主程式
public static void main(String[] args){
//建立Scanner物件
java.util.Scanner sc=
new java.util.Scanner(System.in);
System.out.println("請輸入數字:");
int x=sc.nextInt();
switch(x){
case 1:
System.out.println("星期1");
break;
case 2:
System.out.println("星期2");
break;
case 3:
System.out.println("星期3");
break;
case 4:
System.out.println("星期4");
break;
case 5:
System.out.println("星期5");
break;
case 6:
System.out.println("星期6");
break;
case 7:
System.out.println("星期7");
break;
default:
System.out.println("WTF!");
}
}
}

B10033013 提到...

import java.util.*;
public class asd {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int 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("星期日");
default:
System.out.println("不存在");
}
}
}

B10033027 提到...

import java.util.*;
public class hello{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int i=input.nextInt();
switch(i)
{
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("不存在");
}
}
}

b10033025 提到...

import java.util.*;
public class XD {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
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("不存在");
}
}
}

B10033057 提到...

import java.util.*;
public class day{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");
}

}
}

B10033006 提到...

import java.util.*;
public class Ex523a {
public static void main (String[] args) {
Scanner input=new Scanner (System.in);
int X=input.nextInt();
switch(X){
case 1: System.out.println("星期一");
break;
default:System.out.println("非星期一");
}
}
}

B10033001 提到...

import java.util.*;
public class Ex523a{
public static void main (String[] args){
Scanner input=new Scanner (System.in);
int X=input.nextInt();
switch(X){
case 1:System.out.println("星期一");
break;
default:System.out.println("非星期一");

}
}
}

B10033021 提到...

import java.util.*;
public class hello{
public static void main(String[] args){
Scanner imput=new Scanner(System.in);
int x=imput.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("不存在");
}
}
}

B10033014 提到...

import java.util.*;
public class hello{
public static void main(String [] args){
Scanner imput=new Scanner(System.in);
int x=imput.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("不存在");

}
}
}

b10033039 提到...

import java.util.*;
public class asd {
public static void main(String[]args){
Scanner input= new Scanner(System.in);
int 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("星期日");
default:
System.out.println("不存在");
}
}
}

B10033010 提到...

import java.util.*;
public class hello {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int x = input.nextInt();
switch(x){
case 1: System.out.println("星期一");
break;
default:System.out.println("非星期一");
}
}
}

B10033051 提到...

import java.util.*;
public class hello {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int x = input.nextInt();
switch(x){
case 1: System.out.println("星期一");
break;
default:System.out.println("非星期一");

}
}
}

B10033010 提到...

import java.util.*;
public class hello {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");
}
}
}

B10033001 提到...

import java.util.*;
public class Ex523a{
public static void main (String[] args){
Scanner input=new Scanner (System.in);
int 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;

}
}
}

B10033026 提到...

import java.util.*;
public class java0523 {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("輸入一個1~7之間的整個");

int day = sc.nextInt();

switch (day){

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("不存在");
}
}
}

B10033006 提到...

import java.util.*;
public class Ex523a {
public static void main (String[] args) {
Scanner input=new Scanner (System.in);
int 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;

}
}
}

B10033009 提到...

import java.util.*;
public class java {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("輸入一個1~7之間的整個");

int day = sc.nextInt();

switch (day){

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("不存在");
}
}
}

B10033051 提到...

import java.util.*;
public class ya {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");
}
}
}

b9733191 提到...

import java.util.*;
public class test {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sca = new Scanner(System.in);
int day=sca.nextInt();
switch(day)
{
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("不存在!!!");
}
}

}

b10033049 提到...

import java.util.*;
public class sss9 {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");}}}

b10033042 提到...

import java.util.*;
public class hello9 {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");}}}

b10033034 提到...

import java.util.*;
public class sss9 {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");}}}

b10033007 提到...

import java.util.*;
public class sss9 {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");}}}

b10033018 提到...

import java.util.*;
public class sss9 {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");}}}

b10033031 提到...

import java.util.*;
public class sss9 {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
int 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("不存在");}}}

B10033002 提到...

import java.util.*;
public class jas {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
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("不存在");
}
}
}

B10033044 提到...

import java.util.*;
public class b10033044 {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
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("不存在");
}
}
}

B10033011 提到...

import java.util.*;
public class Hello{
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int 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("星期日");
default:
System.out.println("不存在");
}
}
}

b10033017 提到...

import java.util.*;
public class hello523{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int x=sc.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("不存在");
}
}
}

b10033017 提到...

import java.util.*;
public class hello523{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int x=sc.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("不存在");
}
}
}

B10033005 提到...

import java.util.*;
public class ee {


public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int day = sc.nextInt();

switch(day){

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("不存在");

}

}
}

B10033020 提到...

import java.util.*;
public class hello {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
x=input.nextInt();
//DAY


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("不存在");
}
}

B10033020 提到...

import java.util.*;
public class hello {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
x=input.nextInt();
//DAY
//一、 試利用switch case由程式中直接輸入一個1~7 之間的整數day,代表星期一到星期日。若day 的值是1,則印出 "星期一",若day 的值是2,則印出 "星期二",若day 的值是7,則印出 "星期日",若day 的值不是1~7,則印出 "不存在"。

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("不存在");
}
}

B10033045 提到...

import java.util.*;
public class B10033045 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int 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("星期日");
default:
System.out.println("不存在");
}
}
}

B10033036 提到...

import java.util.*;
public class Hello530 {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int 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("星期日");
default:
System.out.println("不存在");
}
}
}

B9733205 提到...

import java.test.*;
public class asd {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int 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("星期日");
default:
System.out.println("不存在");
}
}
}

B10033004 提到...

import java.util.*;
public class hello{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int i=input.nextInt();
switch(i)
{
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("不存在");
}
}
}

B10033056 提到...

import java.util.*;
public class hello{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int i=input.nextInt();
switch(i)
{
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("不存在");
}
}
}

B10033035 提到...

import java.util.*;
public class asd{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int x=sc.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("不存在");
}
}
}

B10033048 提到...

import java.util.*;
public class h{
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
x=input.nextInt();
5
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("不存在");
}
}
}

B10033050 提到...

import java.util.*;
public class hello{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int i=input.nextInt();
switch(i)
{
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("不存在");
}
}
}

B10033042 提到...

import java.util.*;
public class hello{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
int i=input.nextInt();
switch(i)
{
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("不存在");
}
}
}

b10033028 提到...

import java.util.*;
public class test {
public static void main(String[] args) {
int x;
Scanner input=new Scanner(System.in);
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("不存在");
}
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章