% hw006.m
% John Burkardt
% Get x, y, z from the user.
% Report number of unique values.
%
x = input ( 'Enter value x: ' )
y = input ( 'Enter value y: ' )
z = input ( 'Enter value z: ' )
%
%  One way to do it:
%
unique = 1

if ( y ~= x )
  unique = unique + 1;
end

if ( z ~= x && z ~= y )
  unique = unique + 1;
end

fprintf ( '  Number of unique entries is %d\n', unique )
%
%  Another way.
%
if ( x ~= y )
  if ( z ~= x && z ~= y )
    fprintf ( '  Number of unique entries is 3\n' )
  else
    fprintf ( '  Number of unique entries is 2\n' )
  end
elseif ( z ~= x )
  fprintf ( '  Number of unique entries is 2\n' )
else
  fprintf ( '  Number of unique entries is 1\n' )
end