Files
OI-source/history_source/ccf 入门篇/U4/4.5.3.cpp
2023-08-03 09:22:52 +08:00

18 lines
197 B
C++

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
long long a,b;
while(true)
{
cin>>a>>b;
a=a%10;
for(int i=1;i<b;i++){
a=a*a;
a=a%10;
}
cout<<a<<endl;
}
}