Anyway, wow this was easy. My first attempt solved it in .43 seconds. It's a little crude, but hell I don't even think optimising this is going to make much of a difference. If you see any spots that look to be slowing this down for some reason, let me know.
#include <iostream>
int main() {
for (int i = 1; i > 0; i ++) {
bool found = true;
for (int j = 11; j <= 20; j ++) {
if (i % j != 0)
found = false;
}
if (found) {
std::cout << i;
i = -1;
}
}
return 0;
}
Edit: I knew it was too good to be true, mine takes an extremely long time to run. Oops. I need to start saving the run times in my comment header so I know what the estimated time on it is. =/
Haha, that's how mine tend to go. I usually just throw something together, and then rework it. At least for these PE problems. They seem too short to actually plan out.
P.S. I found #6 to be super easy as well. I had never heard of a pyramidal number, but plugging in the formula for that made it quite easy. Finds the answer in 0.015 seconds with no optimising yet