- 粘贴文本
- 2009-09-17 18:05:40 @
program paste;
var s:ansistring;
j,ls,i,n,k,a,b,c,ca:longint;
si:string;
begin
readln(n,k);
for i:=1 to n do
begin
str(i,si);
ls:=length(si);
for j:=1 to 6-ls do
si:='*'+si;
s:=s+si;
end;
for i:=1 to k do
begin
readln(a,b,c);
ca:=b-a+1;
si:=copy(s,(a-1)*6+1,ca*6);
delete(s,(a-1)*6+1,ca*6);
if a>c then insert(si,s,c*6+1)
else insert(si,s,(c-ca)*6+1);
end;
for i:=1 to 60 do
begin
if s[i]'*' then write(s[i]);
if i mod 6=0 then writeln;
end;
end.
0 条评论
目前还没有评论...