diff --git "a/\351\241\271\347\233\256\344\275\234\344\270\232\357\274\210\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237\357\274\211/\345\274\240\351\221\253/Deom05.java" "b/\351\241\271\347\233\256\344\275\234\344\270\232\357\274\210\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237\357\274\211/\345\274\240\351\221\253/Deom05.java" new file mode 100644 index 0000000000000000000000000000000000000000..2bfb7e73a003b247c561b8c43a024e66b3b491f6 --- /dev/null +++ "b/\351\241\271\347\233\256\344\275\234\344\270\232\357\274\210\345\233\276\344\271\246\347\256\241\347\220\206\347\263\273\347\273\237\357\274\211/\345\274\240\351\221\253/Deom05.java" @@ -0,0 +1,77 @@ +package day01; + +import java.util.Scanner; + +import com.sun.tools.javac.util.Context.Key; + +public class Deom05 { + + public static void main(String[] args) { + Scanner scan = new Scanner(System.in); + String yonghu [][] = new String [10][4]; + String shuji [][] = new String [10][5]; + String chuban [][] = new String [10][3]; + + yonghu[1][0] = "一部"; + yonghu[1][0] = "123"; + yonghu[1][0] = "123456"; + yonghu[1][0] = "普通会员"; + + yonghu[2][1] = "二部"; + yonghu[2][1] = "321"; + yonghu[2][1] = "654321"; + yonghu[2][1] = "高级会员"; + + shuji[1][0] = "1313"; + shuji[1][0] = "老人与海"; + shuji[1][0] = "30"; + shuji[1][0] = "北京出版社"; + shuji[1][0] = "海明威"; + + shuji[2][1] = "1414"; + shuji[2][1] = "三体"; + shuji[2][1] = "35"; + shuji[2][1] = "南京出版社"; + shuji[2][1] = "刘慈欣"; + + chuban[1][0] = "北京出版社"; + chuban[1][0] = "北京"; + chuban[1][0] = "张三"; + + chuban[2][1] = "南京出版社"; + chuban[2][1] = "南京"; + chuban[2][1] = "李四"; + + while (true) { + System.out.println("1.登录 2.注册"); + int key = scan.nextInt(); + if (key == 1) { + while (true) { + System.out.println("请输入用户名"); + String username = scan.next(); + + System.out.println("请输入密码"); + String password = scan.next(); + + boolean flag = false; + + for (int i = 0; i < yonghu.length; i++) { + if (username.equals(yonghu[i][1]) && password.equals(yonghu[i][2])) { + flag = true; + break; + } + if (flag == true) { + System.out.println("登录成功!"); + }else { + System.out.println("该用户不存在或者密码错误!请重新登录!"); + } + } + + } + } + + } + + } + +}