2002

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                             FILE: july.cpp */
/*                                                                            */
/*  An Application For The Partial_Sum Algorithm (AAFTPSA)                    */
/*  ======================================================                    */
/*                                                                            */
/*  Compiled and tested with Visual C++ V6.0                                  */
/*                                                                            */
/*  V1.00   31-JUL-2002   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream>
#include <numeric>

using namespace std ;

#define He 'H', 'e' - 'H',
#define ll 'l' - 'e', 0,
#define o  'o' - 'l', ' ' - 'o',
#define wo 'w' - ' ', 'o' - 'w',
#define rl 'r' - 'o', 'l' - 'r',
#define d  'd' - 'l', ' ' - 'd', '!' - ' ', '\n' - '!'

int values[] = { He ll o  wo rl d } ;

int main()
{
  partial_sum( values, values + 14, ostream_iterator<char>(cout) ) ;

  return 0 ;
}