#include<iostream> using namespace std; int main() { long long int a, b, c, d, e, f, g; while (cin >> a) { cout << "\n"; for (b=0;b<a;b++) { cin >> c >> d; for (g=0;g<d;g++) { for (e=0;e<c+1;e++) { for (f=0;f<e;f++) { cout << e; } cout << "\n"; } e -= 2; for (;e>0;e--) { for (f=0;f<e;f++) { cout << e; } cout << "\n"; } } cout << "\n"; } } }
這是AC!!!