fork download
  1. n = int(input())
  2. c = 1
  3.  
  4. for i in range(1, n + 1):
  5. if i % 2 != 0:
  6. for j in range(i):
  7. print(c + j, end="" if j == i - 1 else "*")
  8. print()
  9. else:
  10. for j in range(i - 1, -1, -1):
  11. print(c + j, end="" if j == 0 else "*")
  12. print()
  13. c += i
  14.  
Success #stdin #stdout 0.11s 14148KB
stdin
5
stdout
1
3*2
4*5*6
10*9*8*7
11*12*13*14*15