Plus
Pin


Problem description Progress
ID 38333. Phone numbers
Темы: Strings    Word processing   

Phone numbers in the mobile phone's address book have one of the following formats:

+7<code><number>

8<code><number>

<number>

where <number> — is seven digits, and <code> — it's three digits or three digits in parentheses. If the code is not specified, then it is considered to be 495. In addition, the telephone number entry may contain the “-” between any two digits (see example).

At the moment, Vasya has only three phone numbers in his address book, and he wants to add another one there. But he cannot understand if such a number is already recorded in the phone book. Help him!

Two phone numbers match if they have the same codes and the same numbers. For example, +7(916)0123456 and 89160123456 — it's the same number.

Input
The first line of the input contains the phone number that Vasya wants to add to his phone's address book. The next three lines contain three phone numbers that are already in the address book of Vasya's phone.

It is guaranteed that each of the entries corresponds to one of the three formats given in the condition.

Imprint
For each phone number in the address book print YES (in capital letters) if it matches the phone number Vasya wants to add to the address book or NO (in capital letters) otherwise.
 

Examples
# Input Output
1 8(495)430-23-97
+7-4-9-5-43-023-97
4-3-0-2-3-9-7
8-495-430
YES
YES
NO

ID 33407. File Analysis - 07
Темы: USE    Word processing   

The first line of the text file indicates the number of lines in the file containing various characters of the English alphabet (from A to Z). Determine the number of lines in which the number of characters denoting a vowel of the English alphabet is greater than the number of characters denoting a consonant. Please answer with one number.

To complete this task, you must write a program. 
 

File  
task24-2.txt

 

ID 39159. File Analysis - 08
Темы: USE    Word processing   

The text file consists of the characters M, A, R, S. Define the maximum number of consecutive characters  in the attached file, among which there are no consecutive characters M. To complete this task, you must write a program.

Assignment file