Fancy Mouse
- -|||
列一个关于行和列的通式吧
第n行第m列一定是f(n,m)这个数……然后把函数一般式求出来就ok了
#include<iostream>
using namespace std;

int main()
{
    
int t,line,row;
    
while(cin>>t)
    
{
        
for(line=0;line<t;line++)
        
{
            cout
<<line*(line+1)/2+1;
            
for(row=1;row<t-line;row++)
                cout
<<' '<<(line+row+1)*(line+row+2)/2-line;
            cout
<<endl;
        }

    }

    
return 0;
}
posted on 2005-08-21 17:45  Fancy Mouse  阅读(346)  评论(1编辑  收藏  举报