View Code of Problem 3696

#include <iostream>
#include <vector>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
using namespace std;
int main() {
    int t;
    while(cin>>t){
        int rs=1;
        for(int i=0;i<t;i++){
            rs=rs*t%10;
        }
        cout<<rs<<endl;
    }

    return 0;
}

Double click to view unformatted code.


Back to problem 3696