Import Java.util.Scanner;
public class date//The little game of a blind date
{
public static void Main (string[] args)
{
Scanner sc = new Scanner (system.in);
System.out.println ("Please enter your gender: such as male/female");
String sex = Sc.next ();
if (Sex.equals ("female")) {
System.out.println ("Please enter your Age:");
int age = Sc.nextint ();
if (age<30) {
System.out.println ("Please enter your height: such as 17.3");
Double height = sc.nextdouble ();
if (height>=16.0) {
System.out.println ("About it.") ");
}else{
System.out.println ("I hope you find the next one soon.") ");
}
}else{
System.out.println ("Sorry.") Customer is not in service area ");
}
}else{
System.out.println ("Sorry, the identity does not match.") ");
}
}
}
Personally think this is a look very clear if nested loops, when I finish this topic, I feel the idea of doing other loops clearer, from the outside, so upload it, albeit very simply,
I do this: this cycle is not written from the top down, but to write an if loop and then write the loop in it, according to the conditions, write it quickly