How to quickly tell which range the number is in?

The
requirement is as follows:
calculate a grade based on an interval

Diamond Shop

< table > < thead > < tr > < th align= "center" > drill into the store < / th > < th align= "center" > Erjing Store < / th > < th align= "center" > three Diamond shops < / th > < th align= "center" > four Diamond Store < / th > < th align= "center" > five Diamond Shop < / th > < / tr > < / thead > < tbody > < tr > < td align= "center" > 1-50 < / td > < td align= "center" > 51-100 < / td > < td align= "center" > 101500 < / td > < td align= "center" > 591-1000 < / td > < td align= "center" > 1001-2000 < / td > < / tr > < / tbody > < / table >

Crown

< table > < thead > < tr > < th align= "center" > Top Store < / th > < th align= "center" > second Crown Store < / th > < th align= "center" > Triple Crown Store < / th > < th align= "center" > four Crown Store < / th > < th align= "center" > five Crown Store < / th > < / tr > < / thead > < tbody > < tr > < td align= "center" > 2001-4000 < / td > < td align= "center" > 4001-6000 < / td > < td align= "center" > 6001-8000 < / td > < td align= "center" > 8001-10000 < / td > < td align= "center" > 10001-12000 < / td > < / tr > < / tbody > < / table >
now each has a number such as: 80 how do I know which paragraph he is? of course, you can if.else . Consider the simplest solution here!
Php
Mar.30,2021

can be realized with if.else , and it can also be realized with switch . Here is a code of switch , which is a bit coquettish and should not be easily imitated (escape

).
  

if you want to be faster, you can search on the balanced binary tree. For java, you can put it on TreeMap, and search through floorEntry ceilEntry .

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b42ce8-40bcc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b42ce8-40bcc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?