PCPOTATO
Navigation

Home
About
Contact
Resume

Projects

None yet

Categories

General
Interesting
Programming

Archives

August 2008
July 2008
June 2008
May 2008
April 2008
Project Euler #6 April 18th, 2008

Finding the difference between the sum of the squares and the square of the sum was pretty easy, but my solution probably has too much white space for some people.

1
2
3
4
5
6
7
8
9
10
11
12
13
#sum of the squares
some = 0
for i in range(101):
	some = some + i*i
 
#square of the sums
squar = 0
tempsum = 0
for i in range(101):
	tempsum = tempsum + i
squar = tempsum * tempsum
 
print abs(some - squar)

On another note, I noticed my site looks like crap in Internet Explorer, but grandmas on their 386’s aren’t visiting this site anyway.

Leave a Reply

You must be logged in to post a comment.

Domains


Links


Presence


Meta

Log in