static void printTest(int num){ int i, j; for(i = num; i > 0; i--) for(j = i; j > 0; j--) System.out.print(i); System.out.print(0); for(i = 1; i <= num; i++) for(j = i; j > 0; j--) System.out.print(i); }
waterlaw
2018-04-03 16:13:35 +08:00
``` def dispaly(n, max, s=[]): for i in range(n): s.append(str(n)) if n - 1 > 0: dispaly(n - 1, max, s=s) else: s.append('0') for i in range(n): s.append(str(n)) if n == max: return ''.join(s)