- 清帝之惑之乾隆
- 2009-03-31 12:28:43 @
各位大牛,帮看看吧!救命啊!一道基础题
program p1010;
const
inf='p1010.in';
ouf='p1010.out';
var
st,s,t:string;
i,j,k,n,p,q,l,x,y:longint;
a,b,c:array[1..2000] of longint;
procedure jisuan;
begin
p:=pos('.',st);
q:=length(st)-p;
delete(st,p,1);
l:=length(st);
fillchar(a,sizeof(a),0);
for i:=1 to length(st) do
a[l-i+1]:=ord(st[i])-48;
for i:=1 to 2000 do
b[i]:=a[i];
for i:=1 to k-1 do begin
for j:=1 to 2000 do begin
c[j]:=a[j];
a[j]:=0;
end;
j:=2000;
while c[j]=0 do dec(j);
for x:=1 to l do
for y:=1 to j do
a[x+y-1]:=a[x+y-1]+c[y]*b[x];
for j:=1 to 1999 do begin
a[j+1]:=a[j+1]+a[j] div 10;
a[j]:=a[j] mod 10;
end;
end;
x:=2000;
while a[x]=0 do dec(x);
y:=1;
while a[y]=0 do inc(y);
for i:=x downto q*k+1 do write(a[i]);
write('.');
for i:=k*q downto y do write(a[i]);
writeln;
end;
begin
assign(input,inf);
reset(input);
assign(output,ouf);
rewrite(output);
while not seekeof do begin
readln(st);
if st='' then break;
while (st[1]=' ')or(st[1]='0') do delete(st,1,1);
while st[length(st)]='0' do delete(st,length(st),1);
k:=pos(' ',st);
s:=copy(st,k,length(st)-k+1);
delete(st,k,length(st)-k+1);
while s[1]=' ' do delete(s,1,1);
val(s,k,j);
jisuan;
end;
close(input);
close(output);
end.
5 条评论
-
huzhaoyang LV 6 @ 2017-02-03 20:06:35
去掉输入输出
-
2015-04-15 13:21:15@
不能输出到文件
-
2014-07-31 09:31:12@
不能输出到文件
-
2014-07-31 09:30:59@
不能输出到文件
-
2009-04-08 21:52:42@
来个人帮下啊!!!
感激不尽
- 1