- import java.util.Scanner;
- class SignUp {
- public static void main(String[] args) {
- for(int a=1;a<=3;a++){
- Scanner sc = new Scanner(System.in);
- System.out.println("请输入用户名:");
- int username=sc.nextInt();
- System.out.println("请输入密码:");
- int password=sc.nextInt();
- if((username==1234) && (password==4567)) {
- for(int i=1; i<=5; i++) {
- for(int j=0; j<=i; j++) {
- System.out.print("*");
- }
- System.out.println();
- }
- break;
- }else{
- System.out.println("您输入的账号密码有误"+"您还有"+(3-a)+"次机会");
- }
-
- }
- }
- }
复制代码
|
|