hdu 2123

#include <iostream>
using namespace std;
int main()
{
    int i,t,n,j,k,f;
    cin>>t;
    while(t--)
    {
        cin>>n;
        for(i=1,j=1;i<=n;cout<<endl,i++,j++)
        {
            //i=1;
            f=i;
            //cout<<"nishisb"<<endl;
            for(k=1;k<=n;i+=j,k++)
				if(k==n)  cout<<i;
				else
                    cout<<i<<" ";
                i=f;
                //cout<<i<<endl;

        }
    }
    return 0;
}
//hdu  2123 

posted @ 2014-12-12 18:04  __夜风  阅读(118)  评论(0编辑  收藏  举报