about summary refs log tree commit diff
path: root/daily/286easy/lairotcaf.pas
diff options
context:
space:
mode:
Diffstat (limited to 'daily/286easy/lairotcaf.pas')
-rw-r--r--daily/286easy/lairotcaf.pas31
1 files changed, 31 insertions, 0 deletions
diff --git a/daily/286easy/lairotcaf.pas b/daily/286easy/lairotcaf.pas
new file mode 100644
index 0000000..ef2c910
--- /dev/null
+++ b/daily/286easy/lairotcaf.pas
@@ -0,0 +1,31 @@
+var
+  fi, fo: text;
+  n, i: int64;
+
+begin
+  assign(fi, 'lairotcaf.inp');
+  assign(fo, 'lairotcaf.out');
+  reset(fi);
+  rewrite(fo);
+  repeat
+    readln(fi, n);
+    write(fo, n);
+    if n > 0 then
+      begin
+        i := 2;
+        while n mod i = 0 do
+          begin
+            n := n div i;
+            inc(i)
+          end;
+        if n = 1 then
+          begin
+            writeln(fo, ' = ', i - 1, '!');
+            continue
+          end
+      end;
+    writeln(fo, ' NONE')
+  until eof(fi);
+  close(fi);
+  close(fo)
+end.