stdcpp/tsrc/Stdcpp_test/stlport/auto/stlport_times/src/times.cpp
changeset 0 e4d67989cc36
child 18 47c74d1534e1
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1  
       
     2 // STLport regression testsuite component.
       
     3 // To compile as a separate example, please #define MAIN.
       
     4 
       
     5 #include <iostream>
       
     6 #include <algorithm>
       
     7 #include <numeric>
       
     8 
       
     9 #ifdef MAIN 
       
    10 #define times_test main
       
    11 #endif
       
    12 
       
    13 #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
       
    14 using namespace std;
       
    15 #endif
       
    16 int times_test(int, char**)
       
    17 {
       
    18   cout<<"Results of times_test:"<<endl;
       
    19 int input [4] = { 1, 5, 7, 2 };
       
    20 
       
    21   int total = accumulate(input, input + 4, 1, multiplies<int>());
       
    22   cout << "total = " << total << endl;
       
    23   if(70!=total)
       
    24     return 1;
       
    25   else  
       
    26     return 0;
       
    27 }