给你解决问题的全部程序。(其实你只要有点耐心,也能写出来^-^)
=======================================================
function getNum(s : String):string;
//该函数有待改进,可取浮点数及其它
var i,j : integer;
begin
result := '';
for i := 1 to length(s) do
if s in ['0'..'9'] then
begin
for j := i to length(s) do
if not(s[j] in ['0'..'9']) then break;
result := copy(s,i,j-i);
break;
end;
end;
function calcNum(s : String):string;
var inValue,outValue : integer;
//这里是你的动算处理程序
begin
inValue := StrToInt(s);
outValue := inValue * 10;
result := IntToStr(outValue);
end;
//以下是调用主程序
var testS,tempS : String;
curNum: string;
begin
testS := 'aiming1234aimt123'; //初值
tempS := testS; testS := '';
curNum := getNum(tempS);
while curNum <> '' do
begin
testS := testS + copy(tempS,1,pos(curNum,tempS)-1) + calcNum(curNum);
tempS := copy(tempS,pos(curNum,tempS) + length(curNum),Length(tempS));
curNum := getNum(tempS);
end;
writeln(testS); //这里的testS就是已经替换完成的串了
end.