Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
391 B
1
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;

    cout << "  ";
    for (int ii = 1; ii <= n; ii++) cout << ii << " ";
    cout << endl;
    for (int i = 1; i <= m; i++)
    {  
        cout << i << " ";
        for (int j = 1; j <= n; j++)
        {
            cout << i * j << " ";
        }
        cout << endl;
    }
}