首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Calculation 高速幂

2012-09-08 
Calculation 快速幂/*本来是稍有复杂的数学题。第一次用快速幂取模果断超时,最后将表打出,找规律。水过之,代

Calculation 快速幂

/*本来是稍有复杂的数学题。第一次用快速幂取模果断超时,最后将表打出,找规律。水过之,代码很短。*/#include <stdio.h>int main(){    int a,b;    while(scanf("%d%d",&a,&b)==2)    {        int ans=0;        int sum=0;        if(a%2==0)        {            int aa=a/2;            if(aa%2==1) ans=aa;            else ans=0;        }        else ans=0;        printf("%d\n",ans);    }    return 0;} 


热点排行