Created
April 10, 2012 15:42
-
-
Save ericduran/2352268 to your computer and use it in GitHub Desktop.
Project Euler challenge #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main () { | |
int i = 1000; | |
int total = 0; | |
while (i--) { | |
if (i % 3 == 0 || i % 5 == 0) { | |
total += i; | |
} | |
} | |
cout << total; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment