License Public Domain
Lines 19
Keywords
Euler28 (8)
Permissions
Owner: mnoble
Group Owner: SnortSnort
Viewable by Everyone
Editable by All Siafoo Users
Hide
Bored? Check out the Recent Activity on Siafoo Join Siafoo Now or Learn More

Euler28: The Spiral - zero finesse Atom Feed 0

# 's
 1include <iostream>
2using namespace std;
3
4int main()
5{
6 int value = 1;
7 int sum = 1;
8 int add = 2;
9
10 for(int i = 0; i < 1000; i+=2)
11 {
12 for(int j = 0; j < 4; j++ )
13 {
14 value += add;
15 sum += value;
16 }
17 add += 2;
18 }
19 cout << sum << endl << endl;
20 return 0;
21}