Skip to content

Instantly share code, notes, and snippets.

@02015678
Last active August 29, 2015 14:14
Show Gist options
  • Save 02015678/6cce4d3006027c199fd7 to your computer and use it in GitHub Desktop.
Save 02015678/6cce4d3006027c199fd7 to your computer and use it in GitHub Desktop.
NK1009 NKPC2 Lucy's Problem Liuhy Solution
Var
a,b,m:string;
i:integer;
x,y:longint;
Procedure f(var n:string);
Begin
m:='';For i:=length(n) downto 1 do m:=m+n[i];n:=m;
End;
BEGIN
readln(a);
i:=pos(' ',a);{弹出子串' '在串a里的位置}
b:=copy(a,i+1,10);{复制子串}
delete(a,i,11);{删除子串,包括空格}
f(a); f(b);{求翻转数A B的原数C D}
val(a,x,i); val(b,y,i);{把串C D转换成数}
inc(x,y);{相加得S}
str(x,a);{把数S转换为串}
f(a);val(a,x,i);{求S的翻转数并且输出}
writeln(x);
END.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment