View Code of Problem 3696

#include<string>
#include<cstring>
#include<iostream>
using namespace std;
//long long a[91];

int main()
{
	int n;
	while (cin >> n)
	{
		if (n == 0)
			cout << 1 << endl;
		else
		{
			int z = n % 10;
			long long int k = pow(z, z);
			int m = k % 10;
			cout << m << endl;
		}
	}
}
/*
Main.cc: In function 'int main()':
Main.cc:17:22: error: 'pow' was not declared in this scope
    long long int k = pow(z, z);
                      ^~~
Main.cc:17:22: note: suggested alternative: 'putw'
    long long int k = pow(z, z);
                      ^~~
                      putw
*/

Double click to view unformatted code.


Back to problem 3696