题解 100% AC
2025-08-02 13:54:48
发布于:江苏
6阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c=1;
cin>>a>>b;
for(int i=1;i<=b;i++){
c*=a;
c%=7;
}
if(c==0){
cout<<"7";
}else if(c==1){
cout<<"1";
}else if(c==2){
cout<<"2";
}else if(c==3){
cout<<"3";
}else if(c==4){
cout<<"4";
}else if(c==5){
cout<<"5";
}else{
cout<<"6";
}
return 0;
}
这里空空如也
有帮助,赞一个