View Code of Problem 3696

#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main() {
	int n;
	while (cin >> n) {
		int m = n % 10;
		cout << (int)pow(m, n) % 10 << endl;
	}
}

Double click to view unformatted code.


Back to problem 3696