无语死了。。。悬赏一关【违规紫杉】
查看原帖
无语死了。。。悬赏一关【违规紫杉】
719614
lihua_miaowu楼主2024/1/1 20:00

额。。。

编译都过不了

#include<bits/stdc++.h>
using namespace std;
int num=0;
int Fast_Power(int x, int y, int z){
	if(y==0) return 1;
	if(y==1) return x%z;
	if(y%2==0){
		return Fast_Power(x%z, y/2%z)%z*Fast_Power(x%z, y/2%z)%z;
	}
	else{
		return x*Fast_Power(x%z, y/2%z)%z*Fast_Power(x, y/2)%z;
	}
}
int main(){
	int a, b, c; //a表示底数,b表示指数,c代表模数
	cin >> a >> b >> c;
	cout << Fast_Power(a, b, c);
	return 0;
}

‘’‘
2024/1/1 20:00
加载中...