/**
@file little_algorithm.cc
@author Mitch Richling <http://www.mitchr.me/>
@Copyright Copyright 2000 by Mitch Richling. All rights reserved.
@brief Example of how to use algorithms in the STL specified by C++ 98.@EOL
@Keywords Standard C++ STL algorithm
@Std C++98
This program is an example of how use the algorithms
found in the <algorithms> header file that is part of
the STL of C++ 98.
min max
swap
*/
#include <iostream> /* C++ iostream C++ */
#include <algorithm> /* STL algorithm C++ */
#include <functional> /* STL funcs C++ */
int main() {
int i = 1;
int j = 2;
std::cout << "Minimum of " << i << " and " << j << " is: " << std::min(i,j) << std::endl;
std::cout << "Maximum of " << i << " and " << j << " is: " << std::max(i,j) << std::endl;
std::cout << "Before val i=" << i << " and j=" << j << std::endl;
std::swap(i, j);
std::cout << "After swap i=" << i << " and j=" << j << std::endl;
}
Generated by GNU Enscript 1.6.5.2.