- A+B Problem
- 2015-01-05 14:54:24 @
var
q,w,e,r,t,y,u,i,o,p:longint;
a,b:array[1..200] of longint;
begin
readln(q,w);
e:= q div w;
r:=q mod w;
if r=0 then
begin
writeln(e);
exit;
end;
for t:=1 to 200 do
begin
y:=r*10 div w;
r:=r*10 mod w;
a[t]:=y;{商}
b[t]:=r;{余数}
if b[t]=0 then
begin
for u:=1 to t do
writeln(e,'.',a[t]);
end;
for u:=1 to t-1 do
if b[t]=b[u] then
begin
write(e,'.');
for p:=1 to u-1 do
write(a[p]);
write('(');
for i:=u to t-1 do
write(a[i]);
write(')');
exit;
end;
end;
for t:=1 to 100 do
writeln(e,'.',a[t]);
end.
0 条评论
信息
- ID
- 1000
- 难度
- 9
- 分类
- (无)
- 标签
- (无)
- 递交数
- 74396
- 已通过
- 28465
- 通过率
- 38%
- 被复制
- 222