Project Euler Homework

001.cpp

Go to the documentation of this file.
00001 
00015 #include <iostream>
00016 using namespace std;
00017 
00018 int
00019 main ()
00020 {
00021   unsigned sum = 0;
00022   for (int k = 1; k < 1000; k++)
00023     {
00024       if (k % 3 == 0)
00025         sum += k;
00026       else if (k % 5 == 0)
00027         sum += k;
00028     }
00029   cout << sum << endl;
00030   return 0;
00031 }
00032 
 All Classes Files Functions Variables