import java.util.Scanner;
public class shirt
{
public static void main(String[] args)
{
Scanner userinput = new Scanner (System.in);
String nbshirts;
System.out.println("How many shirts do you have");
nshirts = userinput.next();
if (nbshirts.equals("five"))
{
System.out.println("Just like me !");
}
else
{
System.out.println("We don't have the same number of shirt");
}
}
}
您好,我想要的是 if/else 语句验证输入是否为 5 或 5 的可能性。我不知道要添加什么/如何继续创建一个对话框,其中 5 和 5 都是接受为真值。希望你能帮我 !:)