考试第8题

 

复制代码
package test8;

import java.util.Scanner;

public class Test {

    static Scanner sc = new Scanner(System.in);
    public void zc() {
        
        while(true) {
        System.out.println("请输入用户名:");
        String name = sc.next();
        System.out.println("请输入密码:");
        String password = sc.next();
        if(name.length()<3||password.length()<6) {
            
            System.out.println("用户名的长度不能小于3,密码长度不能小于6!");
            
            
        }else {
            
            System.out.println("请再次输入密码:");
            String password2 = sc.next();
            if(password2.equalsIgnoreCase(password)) {
                
                System.out.println("注册成功! 请牢记用户名和密码。");
                return;
            }
            
        }
    
        
        
        }
    }
    
    
    public static void main(String[] args) {
        
        System.out.println("****欢迎进入注册系统****");
        Test t = new Test();
        t.zc();
    }
    
}
复制代码

 

本文作者:AxeBurner

本文链接:https://www.cnblogs.com/bichen-01/p/11336428.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   AxeBurner  阅读(101)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.