Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static boolean isSet (int a, int b, int c) {
- if (a == b && b == c) {
- return true;
- } else if (a != b && b != c && a != c) {
- return true;
- } else {
- return false;
- }
- }
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Введите три числа от 1 до 3: ");
- int A = sc.nextInt();
- int B = sc.nextInt();
- int C = sc.nextInt();
- if (isSet(A,B,C)) {
- System.out.println("Ваша комбинация является сетом.");
- } else {
- System.out.println("Ваша комбинация не является сетом.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement