且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

hdu 2123 An easy problem

更新时间:2022-08-13 08:53:37

http://acm.hdu.edu.cn/showproblem.php?pid=2123
注意这里行末不能有空格!!!

#include <iostream>
using namespace std;
int main()
{
    int t,m;
    cin>>t;
    while(t--)
    {
        cin>>m;
        for(int i=1; i<=m; i++)
        {
            for(int j=1; j<=m; j++)
            {
                cout<<i*j;
                if(j==m)
                    cout<<endl;
                else
                    cout<<" ";
            }
        }
    }
    return 0;
}