From 0d9b6ebb4f6e01fb4c241055b6a2d3ddb5089185 Mon Sep 17 00:00:00 2001 From: hanyixuanten Date: Fri, 14 Aug 2026 09:07:03 +0800 Subject: [PATCH] new file: 3.cpp --- 3.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 3.cpp diff --git a/3.cpp b/3.cpp new file mode 100644 index 0000000..1193171 --- /dev/null +++ b/3.cpp @@ -0,0 +1,28 @@ +// 90 +#include +using namespace std; +long long a, b, p; +void put(__int128 a) +{ + char c[40]; + if (a == 0) + puts("0"); + int tot = 0; + while (a > 0) + { + c[tot++] = a % 10 + '0'; + a /= 10; + } + for (int i = tot - 1; i >= 0; --i) + { + putchar(c[i]); + } + puts(""); +} +int main() +{ + cin >> a >> b >> p; + __int128 ans = (a % p) * (b % p) % p; + put(ans); + return 0; +} \ No newline at end of file