Skip to content

Instantly share code, notes, and snippets.

@dcbriccetti
Last active November 19, 2020 03:24
Show Gist options
  • Save dcbriccetti/195cd7217ad60678d693646af3c1445b to your computer and use it in GitHub Desktop.
Save dcbriccetti/195cd7217ad60678d693646af3c1445b to your computer and use it in GitHub Desktop.
public class HasTeen {
public static boolean hasTeen(int a, int b, int c) {
return (a >= 13 && a <= 19) || (b >= 13 && b <= 19) || (c >= 13 && c <= 19);
}
public static void main(String[] args) {
assert hasTeen(13, 20, 10);
assert hasTeen(20, 19, 10);
assert hasTeen(20, 10, 13);
assert !hasTeen(20, 10, 10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment