2 3 5 3 10 7 4 6 12 9 2 1 4 3 7 7 4 2 10 9 24
var s, n,sum,sum1,p,i:integer; sr:real;A:Array[1..10] of integer;BeginA[1]:=2;A[2]:=3;A[3]:=5;A[4]:=3;A[5]:=10;A[6]:=7;A[7]:=4;A[8]:=6;A[9]:=12;A[10]:=9;n:=10;s:=0;for i:=1 to n do write(A[i]:3);writeln;for i:=2 to n do beginif A[i-1] < A[i] then beginA[i]:= A[i] - A[i -1];s:= s + A[i];end;end;for i:=1 to n do write(A[i]:3);writeln;write(s:3);end.