There are several types of telephone numbers available in a university in Beijing: the number on the campus is 4 digits, the 1th digit is not 0; the outside telephone is divided into the city telephone and the field telephone two class, pulls off-campus telephone to first unplug 0, if the city telephone then then pulls out 8 digits (first not 0), If the field calls, unplug the 3-digit area code and then unplug the 8-digit number (the first digit is not 0).
Define the above telephone number using the method of defining the data in the 2.5.2 section.
For:
Phone number =[on-Campus Phone number |
On-campus Phone number = not 0 digits + 3 digits//after continuing to define
Outside phone number =[City number | field number]
City Number = number 0 + 8 digits
Field number = number 0 + 3 digits + 8 digits
Non-0 Digital =[1|2|3|4|5|6|7|8| 9]
Number 0 = 0
3-digit =3{digital}3//3 to 3 digits
8 digits = Non-0 digits + 7 digits
7-bit digital =7{digital}7
Digital =[0|1|2|3|4|5|6|7|8| 9]
Software Engineering Chapter Two after-school exercise 2.5