提交时间:2023-11-10 21:35:17
运行 ID: 30641
#include<iostream> using namespace std; using ll = long long; int main(){ ll b,p,k; cin>>b>>p>>k; ll a=1; for (int i=1;i<=p;i++){ a=a*b%k; } cout<<b<<'^'<<p<<" mod "<<k<<"="<<a<<endl; }