• [1226] A Simple Triangle

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • In this problem you need to make a triangle ,just like the sample out. The element in the ith row and jth column

    should be the product(乘积) of i and j.

  • 输入
  • The first line of input is an integer C which indicate the number of test cases.
    Then C test cases follow.Each test case contains an integer N (1<=N<=20) in a line which mentioned above.
  • 输出
  • For each test case, print out the triangle. the triangle separated by a blank line.
    If the product is more than 9 (product > 9) you should print a space, or you should print two space.The final number of each line don't need print space.
  • 样例输入
  • 3
    5
    6
    7
    
  • 样例输出
  • 1  2  3  4  5
    2  4  6  8
    3  6  9
    4  8
    5
    
    1  2  3  4  5  6
    2  4  6  8  10
    3  6  9  12
    4  8  12
    5  10
    6
    
    1  2  3  4  5  6  7
    2  4  6  8  10 12
    3  6  9  12 15
    4  8  12 16
    5  10 15
    6  12
    7
    
  • 提示
  • 来源
  • Minary
  • 操作

显示春菜