当前位置:   article > 正文

学习java的一个好玩的小程序_java一些有趣的程序

java一些有趣的程序
import java.util.Scanner;
public class Date {
public static void main(String[] args) {

Scanner scan = new Scanner(System.in);   //创建扫描对象

for(int i=1;i>0;){
System.out.println("please input:");
String s=scan.next();
switch(s){
case "sunday" :
System.out.println("today is "+ s);
break;
case "monday":
System.out.println("today is "+ s);
break;
case "tuesday":
System.out.println("today is "+ s);
break;
case "wednesday":
System.out.println("today is "+ s);
break;
case "Thursday":
System.out.println("today is "+ s);
break;
case "Friday":
System.out.println("today is "+ s);
break;
case "Saturday":
System.out.println("today is "+ s);
break;
default:
System.out.println("Sorry I don't know!");

}
}
}
}
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/318333
推荐阅读
相关标签
  

闽ICP备14008679号