模擬QQ登陸


public class QQLogin {
    public static void main(String[] args) {
        int id1 = 123456;
        String pwd1 = "zhangsan123";
        Scanner scanner = new Scanner(System.in);
        System.out.println("請輸入賬號");
        int id = scanner.nextInt();
        System.out.println("請輸入密碼");
        String pwd = scanner.next();
        if (id == id1 && pwd.equals(pwd1)) {
            System.out.println("登錄成功!");
        } else if (id != id1 && pwd.equals(pwd1)) {
            System.out.println("賬號信息有誤!");
        } else if (id == id1 && !(pwd.equals(pwd1))) {
            System.out.println("密碼信息有誤!");
        } else {
            System.out.println("賬號與密碼都有誤!");
        }
    }
}
  • 運行結果


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM