#include #include #include #include "lmd.h" using namespace std; int main() { // 1,1,2,3,5,8,13,21,34,55,89,144 ... という数列を20項目まで生成 vector fib(20); fib[0] = fib[1] = 1; for( size_t i=2; i::iterator i=fib.begin(), e=fib.end(); i!=e; ++i ) { i = find_if(i,e, X%3==2 || X%5==4 ); if( i==e ) break; cout << *i << ' '; } cout << endl; }