2,3,4......101===生成1
102,3,4......201===生成2
202,3,4......201===生成3
302,3,4......301===生成4
402,3,4......401===生成5

解决方案 »

  1.   

    2,3,4......101===生成1//除外
    n02,3,4......n01===生成n+1
      

  2.   


    I have interger numbers from 2 to 2001(2,3,4,5,6,7,..........2001).
    now,i have a iteration testing these numbers,when the  current number is 
    within the range of (  2,3,4,5,6.....101),I'll get 1;
    within the range of (102,103,104,105,106.....201),I'll get 2;
    within the range of (202,203,204,205,206.....301),I'll get 3;
    .....
    within the range of (1902,1903,1904,1905,1906.....2001),I'll get 3;
      

  3.   


    I have integer numbers from 2 to 2001(2,3,4,5,6,7,..........2001).
    now,i have a iteration testing these numbers,when the current number is  
    within the range of ( 2,3,4,5,6.....101),I'll get 1;
    within the range of (102,103,104,105,106.....201),I'll get 2;
    within the range of (202,203,204,205,206.....301),I'll get 3;
    .....
    within the range of (1902,1903,1904,1905,1906.....2001),I'll get 3;
      

  4.   

    I have integer numbers from 2 to 2001(2,3,4,5,6,7,..........2001).
    now,i have a iteration testing these numbers,when the current number is   
    within the range of ( 2,3,4,5,6.....101),I'll get 1;
    within the range of (102,103,104,105,106.....201),I'll get 2;
    within the range of (202,203,204,205,206.....301),I'll get 3;
    .....
    within the range of (1902,1903,1904,1905,1906.....2001),I'll get 20;
      

  5.   

    $n = 2;
    echo ceil(($n-1)/100);这样就可以了,你可以自己验证一下for($n=2; $n<2002; $n++)
      echo $n, ':', ceil(($n-1)/100), PHP_EOL;
      

  6.   

    I tried it another way: floor(($n-1)/101)+1,but have got a wrong result.Thank you,buddy.
    Would you like to make me your qq friends? 1150624286
      

  7.   

    you mean that you want to use mod?