zoukankan      html  css  js  c++  java
  • hdu1097A hard puzzle

    #include <iostream>
    using namespace std;
    int main()
    {
        long long n,m,i,mul;
        while(cin >> n >> m)
        {
            mul = 1;
            m = m % 4;        //找规律,一个数的n次方。。它的个位数四次一循环
            if(!m)
            m += 4;
            for(i = 0 ; i < m ; ++i)
            {
                mul = mul * n % 10;
            }
            cout << mul % 10 << endl; 
        }
        return 0;
    }
  • 相关阅读:
    bzoj1027
    bzoj1069
    poj2079
    poj2187
    bzoj2281
    bzoj2285
    bzoj1558
    bzoj1822
    bzoj1559
    bzoj1570
  • 原文地址:https://www.cnblogs.com/fchx/p/2880500.html
Copyright © 2011-2022 走看看