Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. def main():
  2.     T = input()
  3.  
  4.     for t in xrange(T):
  5.         N = input()
  6.        
  7.         total = 0
  8.         for n in xrange(1, N):
  9.             if not n % 3 or not n % 5:
  10.                 total += n
  11.         print total
  12.  
  13. if __name__ == '__main__':
  14.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement