function Z = calcul(x1, x2, x3)
Z = x1 ^ 2 + 2 * x2 ^ 2 + 3 * x3 ^ 2 + 2 * x1 * x2 + 3 * x2 * x3 + 5 * x2 * x3;
% calcul(x1, x2, x3) is a design formulas
% The x1, x2, x3 must be number
% For example calcul(1, 1, 1)
% ans =
% 16
clc
clear
x = input('please input a number');
str = num2str(x);
for i = 1 ; length(str)
r(i) = str2double(str(i));
end
if length(r) == 1
disp('the answer is 0');
else
for j = 2 ; length(r)
s = find(r(1 : j - 1) > r(j))
u(j) = length(s)
result = sun(u)
end
disp('the ansser is');
disp(result);
end