标签:string turn ios name span space amp printf mes
#include"iostream" #include"cstdio" #include"cstring" #include"cstdlib" using namespace std; int ans=0; int a,b; int c; int quick(int a,int b,int c) { int ans=1; a=a%c; while(b!=0) { if(b&1){//判断b是否为奇数 printf("b=%d\n",b); ans=(ans*a)%c; } b>>=1; a=(a*a)%c; } return ans; } int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) { int ans=0; ans=(ans+quick(a,b,9))%9; printf("%d\n",ans); } return 0; }
标签:string turn ios name span space amp printf mes
原文地址:https://www.cnblogs.com/syjp/p/11082122.html