C++60 Count Derangements Count Derangements 1.소스 #include using namespace std; int countDer(int n) { // Base cases if (n == 1) return 0; if (n == 0) return 1; if (n == 2) return 1; // countDer(n) = (n-1)[countDer(n-1) + der(n-2)] return (n-1)*(countDer(n-1) + countDer(n-2)); } // Driver program int main() { int n = 4; cout 2016. 8. 3. boost to_upper_copy boost to_upper_copy // boost::algorithm::to_upper_copy — Convert to upper case. // Synopsis // // In header: // template OutputIteratorT to_upper_copy(OutputIteratorT Output, const RangeT & Input, const std::locale & Loc = std::locale()); template SequenceT to_upper_copy(const SequenceT & Input, const std::locale & Loc = std::locale()); 1.소스 // #include #include int main( int argc , char ** argv.. 2016. 8. 1. boost iterator_range boost iterator_range class iterator_range namespace boost { template class iterator_range { public: // Forward Range types typedef ForwardTraversalIterator iterator; typedef ForwardTraversalIterator const_iterator; typedef iterator_difference::type difference_type; public: // construction, assignment template iterator_range( Fo.. 2016. 8. 1. boost c++ 라이브러리 사용하기 ][ find iterator boost c++ 라이브러리 사용하기 ][ find iterator ■ find iterator ■ 실행결과 2016. 8. 1. 이전 1 2 3 4 5 6 7 8 ··· 15 다음