SHARE
TWEET

Untitled

a guest Jul 21st, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void main(String[] args) {
  2.             System.out.println("Здравствуйте. Введите номер карты:");
  3.             Scanner sc = new Scanner(System.in);
  4.             String CardNumber = sc.nextLine();
  5.             String[] subCardNumber;
  6.             String delimeter = "-";
  7.             subCardNumber = CardNumber.split(delimeter);
  8.             if (subCardNumber.length != 4 & subCardNumber[0].length() != 4 & subCardNumber[1].length() != 4 & subCardNumber[2].length() != 4 & subCardNumber[3].length() != 4)
  9.                 System.out.println("Ошибка. Введите верный номер карты:");
  10.             else System.out.println("Верный номер карты");
  11.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top