From f25d961f9cf93d10b82416db6c6d1293ddc96855 Mon Sep 17 00:00:00 2001 From: tommi27 Date: Thu, 28 Mar 2019 17:14:30 +0100 Subject: [PATCH] did stuff --- hello.c | 2 +- modular_exponentiation.py | 16 ++++++++++++++++ modulat.txt | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 modular_exponentiation.py create mode 100644 modulat.txt diff --git a/hello.c b/hello.c index 9176465..aeb89ea 100644 --- a/hello.c +++ b/hello.c @@ -2,5 +2,5 @@ // vim: set ts=4 sw=4 tw=80 et: int main() { - printf("Hello\n"); + printf("Hello World!\n"); } diff --git a/modular_exponentiation.py b/modular_exponentiation.py new file mode 100644 index 0000000..49dc8e7 --- /dev/null +++ b/modular_exponentiation.py @@ -0,0 +1,16 @@ +import math +import sys + +def mod_exp(x, y, m): + k = x % m + for i in range(y): + print(i) + k = (k * x) % m + return k + +line = sys.stdin.readline().split() +x = int(line[0]) +y = int(line[1]) +m = int(line[2]) + +print(mod_exp(x, y, m)) diff --git a/modulat.txt b/modulat.txt new file mode 100644 index 0000000..3ccf376 --- /dev/null +++ b/modulat.txt @@ -0,0 +1 @@ +457327 129852986013369 53279108