Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef unsigned long long ull;
- ull pow(ull b, ull e) {
- ull ans = 1;
- while (e) {
- if (e & 1) {
- ans = ans * b;
- }
- b *= b;
- e >>= 1;
- }
- return ans;
- }
- int main(void) {
- ull b, e;
- scanf_s("%llu %llu", &b, &e);
- printf("%llu", pow(b, e));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement