高精度求模

int hmod(string a,int b)//高精度取余单精度 输出余数
{
    int temp=0;
    unsigned long len=a.length();
    for(int i=0;i<len;i++)
        temp=(temp*10+a[i]-'0')%b;
    return temp;
}

 

posted @ 2016-09-09 12:08  俺叫王梦涵  阅读(145)  评论(0编辑  收藏  举报