1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

解决方案 »

  1.   

    int j = 1;
    int iEleCount = 0; 
    for(int i=1;i<100;i++)
    {
    Response.Write(i.ToString());
    iEleCount ++;
    if( iEleCount == j)
    {

    Response.Write("<BR>");
    iEleCount = 0;
    j++;
    }
    }
      

  2.   

    int col = 1;
                int max = 15;// max value
                int total = 1;
                string str = "";
                for (int i = 1; i < col + 1; )
                {
                    if (total > max)
                        break;                str += " " + total.ToString();                i++;
                    total++;
                    if (i > col)
                    {
                        i = 1;
                        col++;
                        str += "\r\n";
                    }
                }           //str is your need string