fork download
  1. x=3
  2. counter=0
  3. iterations=0
  4. if 1 <= x <= 3*9:
  5. for s in range(max(1,x-2*9),1+min(9,x)):
  6. for d in range(max(0,x-s-9),1+min(9,x-s)):
  7. iterations+=1
  8. counter+=1
  9. print(counter,": ",s,d,x-s-d,sep='')
  10. print("iterations=",iterations)
Success #stdin #stdout 0.04s 9376KB
stdin
Standard input is empty
stdout
1: 102
2: 111
3: 120
4: 201
5: 210
6: 300
iterations= 6