Skip to content

Instantly share code, notes, and snippets.

@ericduran
Created April 10, 2012 15:42
Show Gist options
  • Save ericduran/2352268 to your computer and use it in GitHub Desktop.
Save ericduran/2352268 to your computer and use it in GitHub Desktop.
Project Euler challenge #1
#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