about summary refs log tree commit diff
path: root/others/volume1/054.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/054.pas')
-rw-r--r--others/volume1/054.pas21
1 files changed, 21 insertions, 0 deletions
diff --git a/others/volume1/054.pas b/others/volume1/054.pas
new file mode 100644
index 0000000..ad29f4d
--- /dev/null
+++ b/others/volume1/054.pas
@@ -0,0 +1,21 @@
+uses clib;
+
+var
+  n, c: int16;
+  a: int32;
+  s: int64 = 0;
+
+begin
+  readln(n);
+  c := 0;
+  repeat
+    read(a);
+    if issquare(a) then
+      begin
+        inc(c);
+        s := s + a
+      end;
+    dec(n)
+  until n = 0;
+  writeln(c, ' ', s)
+end.