点击打开链接
#include<stdio.h> int main() { int i,j,n,t; scanf("%d",&t); while(t--) { scanf("%d",&n); for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { printf("%d",i*j); if(j!=n)printf(" "); } printf("\n"); } } return 0; }