We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 777317f commit 762c99fCopy full SHA for 762c99f
869B/the-eternal-immortality.cpp
@@ -1,18 +1,16 @@
1
-#include <iostream>
+#include <bits/stdc++.h>
2
using namespace std;
3
4
-typedef unsigned long long ull;
5
-
6
int main() {
7
- ull a, b;
+ long long a, b;
8
cin >> a >> b;
9
10
- ull res = 1;
11
- for (ull i = a + 1; i <= b; i++) {
12
- res = (res % 10) * (i % 10);
13
- if (res % 10 == 0) break;
+ long long ans = 1;
+ for (long long i = a + 1; i <= b; i++) {
+ ans = (ans % 10) * (i % 10);
+ if (ans % 10 == 0) {
+ break;
+ }
14
}
15
- cout << res % 10 << "\n";
16
+ cout << ans % 10 << endl;
17
return 0;
18
0 commit comments