/* Puzzle D19 -- clamping: change all integers
greater than X to X and all integers less than -X to -X */
void clamp( int size, int arr[], int x )
{
int j;
for ( j=0; j<size; j++ )
{
if ( arr[j] < -x )
arr[j] = -x;
else if ( arr[j] > x )
arr[j] = x;
}
}