Description
给出一个五位数abcde,对这个五位数做两步操作
第一步:重组为一个新的五位数acedb
第二步:输出acedb^5的后五位
Input
一个五位数abcde
Output
输出acedb^5的后五位
Sample Input
12345
Sample Output
71232
Solution
水题,注意乘的时候会爆int,要以05d%输出
Code
#include<cstdio>
#include<iostream>
using namespace std;
typedef long long ll;
int n;
int main()
{
while(~scanf("%d",&n))
{
int m=n/10000*10000+n/100%10*1000+n%10*100+n/10%10*10+n/1000%10;
ll ans=1ll;
for(int i=0;i<5;i++)ans=ans*m%100000;
printf("%05d\n",ans);
}
return 0;
}