Comrades, the problem has arisen on the site to determine the region by the number entered by the user. Those who are familiar, do not tell me how to implement

  • write with pens if'y - 0-Level UNIX Monk
  • How do you like it better - at least through if, at least through switch, at least through the list. - Enikeyschik
  • I do not understand your logic a bit. And with what do you propose to compare the number @ Enikeyschik - Denis Gavrilyuk
  • Have you forgotten your own question? With the number that the user entered. - Enikeyschik
  • one
    So determine. What is the problem? - Enikeyschik

1 answer 1

Link to the site with phone codes: https://phonenum.info/country-code/

Parse the information into two arrays and look for matches of the first characters in it. Then refer to the second index and print the answer.