import java.util.Scanner;
class Yanzheng{
private String n;
private String p;
public void setNa(String na){
this.n = na;
}
public void setPa(String pa){
this.p = pa;
}
public String getNa(){
return n;
}
public String getPa(){
return p;
}
public boolean fun1(String name,String password){
if(name.equals(getNa()) && password.equals(getPa())){
return true;
}
else{
return false;
}
}
}
class Caozuo{
private String name;
private String password;
public String str;
public void setName(String name){
this.name = name;
}
public void setPassword(String password){
this.password = password;
}
public String getName(){
return name;
}
public String getPassword(){
return password;
}
Yanzheng yz = new Yanzheng();
public String fun2(){
if(yz.fun1(getName(),getPassword())){
str = "欢迎" + name + " 帅哥光临";
}else{
str = "用户名或密码输入错误";
}
return str;
}
public void fun3(){
Scanner in = new Scanner(System.in);
String na = in.next();
String pa = in.next();
Yanzheng yz = new Yanzheng();
yz.setNa(na);
yz.setPa(pa);
}
}
public class ZhuceXitong{
public static void main(String args[]){
System.out.println("开始注册,请输入注册名和密码!");
Scanner in = new Scanner(System.in);
Caozuo cz = new Caozuo();
cz.fun3();
System.out.println("注册成功,请登录!");
System.out.println("请输入用户名和密码!");
String name = in.next();
String password = in.next();
cz.setName(name);
cz.setPassword(password);
System.out.println(cz.fun2());
}
}
幕布斯7119047
繁星点点滴滴
相关分类