about summary refs log tree commit diff
path: root/others/volume1/096.pas
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-28 11:34:35 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-28 11:34:35 +0700
commitb7e55e6510690093d61f9cc1152e0330e55fe90b (patch)
tree36b48f77d96adaaaefc7728c8a95ca5d4342d653 /others/volume1/096.pas
parent7ebfa64719d4ac86b30075c65f21eafe9097853e (diff)
downloadcp-b7e55e6510690093d61f9cc1152e0330e55fe90b.tar.gz
Update others/volume1
Diffstat (limited to 'others/volume1/096.pas')
-rw-r--r--others/volume1/096.pas28
1 files changed, 2 insertions, 26 deletions
diff --git a/others/volume1/096.pas b/others/volume1/096.pas
index 4cb877c..b204835 100644
--- a/others/volume1/096.pas
+++ b/others/volume1/096.pas
@@ -1,34 +1,10 @@
-uses math, strutils;
+uses clib;
 
 var
   a, b: ansistring;
-  n: int16;
-  remain: boolean = false;
-  d: uint8;
 
 begin
   readln(a);
   readln(b);
-  n := max(length(a), length(b)) + 1;
-  a := addchar('0', a, n);
-  b := addchar('0', b, n);
-  repeat
-    if remain then
-      d := ord(a[n]) + ord(b[n]) - 47
-    else
-      d := ord(a[n]) + ord(b[n]) - 48;
-    if d > 57 then
-      begin
-        dec(d, 10);
-        remain := true
-      end
-    else
-      remain := false;
-    a[n] := chr(d);
-    dec(n)
-  until n = 0;
-  if ord(a[1]) = 48 then
-    writeln(copy(a, 2, length(a) - 1))
-  else
-    writeln(a)
+  writeln(addintstr(a, b))
 end.