zoukankan      html  css  js  c++  java
  • 数论 --- 找规律

    A hard puzzle

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
    Total Submission(s): 28099    Accepted Submission(s): 10019


    Problem Description
    lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.everybody objects to this BT problem,so lcy makes the problem easier than begin.
    this puzzle describes that: gave a and b,how to know the a^b's the last digit number.But everybody is too lazy to slove this problem,so they remit to you who is wise.
     
    Input
    There are mutiple test cases. Each test cases consists of two numbers a and b(0<a,b<=2^30)
     
    Output
    For each test case, you should output the a^b's last digit number.
     
    Sample Input
    7 66 8 800
     
    Sample Output
    9 6
     
    【题目分析】
    就是简单的找规律,规律很强。
     
    #include<cstdio>
    int fun[10][4]=
    {
        0,0,0,0,
        1,1,1,1,
        2,4,8,6,
        3,9,7,1,
        4,6,4,6,
        5,5,5,5,
        6,6,6,6,
        7,9,3,1,
        8,4,2,6,
        9,1,9,1
    };
    int main()
    {
        int a,b;
        while(scanf("%d%d",&a,&b)!=EOF)
        {
            printf("%d
    ",fun[a%10][(b-1)%4]);
        }
        return 0;
    }
  • 相关阅读:
    SSH入门常用命令
    Charles基础
    经典测试用例
    Fiddler基础教程
    增、删、改、查
    一位软件测试工程师浅谈用户体验
    用户体验测试点
    IIS测试环境搭建
    禅道Bug管理工具环境搭建
    LineageOS源码定制手机系统
  • 原文地址:https://www.cnblogs.com/crazyacking/p/3755314.html
Copyright © 2011-2022 走看看