Project Euler Homework

006.cpp

Go to the documentation of this file.
00001 
00013 #include <iostream>
00014 using namespace std;
00015 int
00016 main ()
00017 {
00018   unsigned sq_of_sum = 100 * (100 + 1) / 2;
00019   sq_of_sum *= sq_of_sum;
00020 
00021   unsigned sum_of_sq = 0;
00022   for (int i = 1; i <= 100; i++)
00023     sum_of_sq += i * i;
00024 
00025   cout << (sq_of_sum - sum_of_sq) << endl;
00026   return 0;
00027 }
00028 
 All Classes Files Functions Variables