about summary refs log tree commit diff
path: root/others/volume1/003.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/003.pas')
-rw-r--r--others/volume1/003.pas15
1 files changed, 15 insertions, 0 deletions
diff --git a/others/volume1/003.pas b/others/volume1/003.pas
new file mode 100644
index 0000000..a4818da
--- /dev/null
+++ b/others/volume1/003.pas
@@ -0,0 +1,15 @@
+var
+  n: int64;
+  l, s: byte;
+
+begin
+  readln(n);
+  l := 0;
+  s := 0;
+  repeat
+    inc(l);
+    s := s + n mod 10;
+    n := n div 10
+  until n = 0;
+  writeln(l, ' ', s)
+end.