最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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ó)家法律
清远市| 昭通市| 临城县| 通江县| 唐山市| 宁夏| 绥滨县| 同江市| 尚志市| 常州市| 石台县| 沾化县| 栾川县| 淳安县| 新绛县| 海晏县| 泸西县| 茶陵县| 建阳市| 翼城县| 区。| 宁乡县| 江孜县| 濮阳县| 海门市| 松滋市| 托克托县| 周至县| 政和县| 海晏县| 应用必备| 什邡市| 微山县| 昌吉市| 宝丰县| 万宁市| 南宫市| 莱阳市| 临潭县| 常熟市| 铁岭县|