(7)循环语句
来源:互联网 发布:字符串全排列 java 编辑:程序博客网 时间:2024/06/07 04:01
import java.util.Scanner;public class a_java {public static void main(String[] args) {int week = 0;System.out.print("请输入1~5任意一个数字\t");Scanner scan = new Scanner(System.in);int your_num = scan.nextInt();week = your_num;System.out.println("今天星期几?");switch(week){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("星期五1");break;default:System.out.println("没有结果。");}}}
<pre name="code" class="java">Scanner scan = new Scanner(System.in);System.out.print("请输入登录名:\t");String user_name = scan.nextLine();System.out.print("请输入登录密码:\t");String password = scan.nextLine();if(!user_name.equals("mr")){System.out.print("用户名非法!!!");}else if(!user_name.equals("mrsoft")){System.out.print("登录密码错误!!!");}else{System.out.print("登录OK~~6666666666666666666");}
0 0
- (7)循环语句
- 循环结构(循环语句)
- Shell 编程7(循环语句while)
- Theano(7):Theano循环语句,Scan
- 循环语句(for循环,while循环,do-while循环)
- for循环语句(2)
- for循环语句(3)
- Python循环语句(while)
- (5)python循环语句
- javascript循环语句(三)
- Java知识(循环语句)
- 第7周作业1-循环大战(FOR语句)
- 第7周作业1-循环大战(WHILE语句)
- Python新路程(7)Python 循环语句
- C#循环语句(while语句和for语句)
- Scala基础教程(四):if语句、循环语句、while语句
- 循环语句
- 循环语句
- php date 输出指定时间
- iOS UISearchBar 和 UISearchDisplayController的使用
- spring MVC原理
- redis事务的那些事情
- java-泛型
- (7)循环语句
- 深入分析JavaWeb Item45 -- Struts2封装请求参数与类型转换
- 欢迎使用CSDN-markdown编辑器
- JDK中的URLConnection参数详解
- Html5添加带备忘录功能的简单的日期选择器插件教程
- sencha touch 学习(1)
- java免费发送邮件实现
- PS把矩形选框通过自由变换变成梯形
- 常用git 命令清单