import java.util.*; import *; public class H7323 { /** * @param args */ public static void main(String[] args) { Scanner a = new Scanner(System.in); System.out.println("请输入用户名:"); String name = a.next(); Scanner b= new Scanner(System.in); System.out.println("请输入密码:"); int pin = b.nextInt(); if (name=="青"&&pin==123){ System.out.print("欢迎你,青!"); }else{ System.out.print("对不起,你不是青!"); } } // TODO Auto-generated method stub }
import java.util.Scanner; public class H7323 { public static void main(String[] args) { Scanner a = new Scanner(System.in); System.out.println("请输入用户名:"); String name = a.next(); Scanner b = new Scanner(System.in); System.out.println("请输入密码:"); int pin = b.nextInt(); if ( "青".equals(name) && pin == 123) { System.out.print("欢迎你,青!"); } else { System.out.print("对不起,你不是青!"); } } }怎么这样呀?输入密码的时候就和死机似的,我输出的123,半天就出来个12.而且按回车也不往下进行呀?
import java.util.Scanner; public class H7323 { public static void main(String[] args) { Scanner a = new Scanner(System.in); System.out.println("请输入用户名:"); String name = a.next(); Scanner b = new Scanner(System.in); System.out.println("请输入密码:"); int pin = b.nextInt(); if ( "青".equals(name) && pin == 123) { System.out.print("欢迎你,青!"); } else { System.out.print("对不起,你不是青!"); } } }哪位大神知道咋回事不?