QQ简单登陆

作者在 2008-06-21 10:47:58 发布以下内容
import java.util.Scanner;
class Test{
String id;
String passWord;
 Test(String id,String passWord){
        this.id=id;
        this.passWord=passWord;
        }
}
public class QQ{
       public static void main(String[] args){
        int i = 0;
        Test card = new Test("244616861","123456789");
  Scanner sr = new Scanner(System.in);
        do{
  System.out.print("请输入QQ账号: ");
  String input1=sr.next();
  System.out.print("请输入密码: ");
  String input2=sr.next();
  if((card.id.equals(input1))&&(card.passWord.equals(input2))){
                          System.out.println("登陆成功");
   break;
                       }else{
                          System.out.println("登录失败");
                            }
       i++;
  }while (i < 3);
        }
}
默认分类 | 阅读 2683 次
文章评论,共0条
游客请输入验证码
浏览52735次
文章分类