Last active
August 29, 2015 14:14
-
-
Save 02015678/6cce4d3006027c199fd7 to your computer and use it in GitHub Desktop.
NK1009 NKPC2 Lucy's Problem Liuhy Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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