Advertisement
Guest User

سوالات امتحان نهایی 1 قسمت ب

a guest
Jun 1st, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. def ma(n):
  2.     a=n
  3.     b=0
  4.     while a!=0:
  5.         a=a//10
  6.         b=b+1
  7.     c=0
  8.     for i in range(b):
  9.         d=n//10**i%10
  10.         c=c+d
  11.     return c
  12. n=int(input())
  13. for i in range(1,n):
  14.     a=ma(i)
  15.     if a%13==0:
  16.         print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement