必对题解
2025-09-01 18:12:41
发布于:天津
40阅读
0回复
0点赞
代码如下:
#include<bits/stdc++.h>
using namespace std;
void f(int a,int b){
int s=1;
for(int i=1;i<=b;i++){
s*=a;
s%=7;
}
if(s==0)cout<<7;
else cout<<s;
}
int main(){
int a,b;
cin>>a>>b;
f(a,b);
return 0;
}
全部评论 2
不是,你这代码我不运行都知道不规范(可能对的),你void函数的返回(return ;)呢
2025-09-08 来自 江苏
0是,应该加
1周前 来自 天津
0
程序对的话请点一个赞
2025-09-01 来自 天津
0
有帮助,赞一个