无码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ó)家法律
黎平县| 德惠市| 新营市| 宁蒗| 胶南市| 安康市| 阿巴嘎旗| 新蔡县| 霞浦县| 新津县| 加查县| 阿勒泰市| 高淳县| 宜阳县| 东莞市| 泸定县| 舟曲县| 乃东县| 怀柔区| 金门县| 冕宁县| 广汉市| 黄龙县| 徐汇区| 新野县| 东安县| 金川县| 龙门县| 广州市| 邹城市| 凌源市| 航空| 江川县| 淮滨县| 开原市| 延川县| 株洲县| 额敏县| 治县。| 承德县| 昭平县|