Guest User

Untitled

a guest
Feb 29th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. Possible=()
  2. Last_Impossible=1
  3. Successive_Possible=0
  4. n=1
  5. maxc=n/20
  6. maxb=n/9
  7. maxa=n/6
  8.  
  9. while Successive_Possible < 6:
  10.     for c in range(0,maxc):
  11.         for b in range(0,maxb):
  12.             for a in range(0,maxa):
  13.                 if (6*a)+(9*b)+(20*c)==n:
  14.                     Possible +=(n,)
  15.                     break
  16.                 if n in Possible:
  17.                     break
  18.             if n in Possible:
  19.                 break
  20.         #Put counter conditional here, and then your else clause after it
  21.     if n in Possible:
  22.         #Counter stuff
  23.         Successive_Possible +=1
  24.         print "Successive Possible #:",Successive_Possible,"Number:",n
  25.         n +=1
  26.     else:
  27.         #What do you think?
  28.         Last_Impossible=n
  29.         Successive_Possible=0
  30.         n +=1
  31.  
  32. print Possible
  33. print Last_Impossible
Advertisement
Add Comment
Please, Sign In to add comment