无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

[代碼展示]登錄

2019-12-03 18:04 作者:kands-code  | 我要投稿

還請(qǐng)各位幫忙看看,修改一下

注:這不能生成一個(gè)登錄界面,而是一個(gè)思路


import java.util.*;

public class NjavaT01 {
??? public static void greeting(String name) {
??????? System.out.println("Hello, "+name+" ! Welcome to CoLand.");
??? }
??? static Map<String,String> userStorage = new HashMap<>();
??? public static void main(String []args) {
??????? MAINLOOP:while(true){
??????????? Scanner sc = new Scanner(System.in);
??????????? System.out.println("Please enter your order(number): ");
??????????? System.out.println("1. login.");
??????????? System.out.println("2. register.");
??????????? int order = sc.nextInt();
??????????? if(order == 1) {
??????????????? System.out.println("Please enter your nameL: ");
??????????????? String usernameL = sc.next();
??????????????? if(userStorage.containsKey(usernameL)) {
??????????????????? for(int i = 3;i >= 0;i--) {
??????????????????????? System.out.println("Please enter you passwordL: ");
??????????????????????? String passwordL = sc.next();
??????????????????????? if(passwordL.equals(userStorage.get(usernameL))) {
??????????????????????????? greeting(usernameL);
??????????????????????????? break MAINLOOP;
??????????????????????? } else {
??????????????????????????? System.out.println("Your password is wrong.");
??????????????????????????? System.out.println("Please try again !");
??????????????????????? }
??????????????????? }
??????????????? } else {
??????????????????? System.out.println("Your name is not exist.");
??????????????????? System.out.println("Please try again or to regist");
??????????????? }
??????????? } else if(order == 2) {
??????????????? System.out.println("Please enter your nameR: ");
??????????????? String usernameR = sc.next();
??????????????? System.out.println("Please enter your passwordL:");
??????????????? String passwordR = sc.next();
??????????????? LOOP:for(int i = 3;i >= 0;i--) {
??????????????????? System.out.println("Please enter your password again:");
??????????????????? String passwordRR = sc.next();
??????????????????? if(passwordR.equals(passwordRR)) {
??????????????????????? userStorage.put(usernameR,passwordR);
??????????????????????? System.out.println("You have successfully regist");
??????????????????????? break LOOP;
??????????????????? }else {
??????????????????????? System.out.println("Your passwords can not match.");
??????????????????? }
??????????????? }
??????????? } else {
??????????????? System.out.println("Your order is wrong !");
??????????? }
??????? }
??? }
}


[代碼展示]登錄的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
屏南县| 肥西县| 浦北县| 宣城市| 南澳县| 合水县| 喀喇| 竹北市| 桂东县| 广州市| 阆中市| 泰州市| 龙口市| 西平县| 石城县| 舒城县| 龙江县| 吴桥县| 株洲市| 青州市| 东乡族自治县| 丰都县| 郓城县| 澎湖县| 什邡市| 微山县| 临安市| 屏东市| 宁化县| 霸州市| 铜陵市| 略阳县| 汕头市| 岳普湖县| 凌云县| 中方县| 湘潭市| 秦安县| 军事| 加查县| 阳春市|