P8813!!!
  • 板块学术版
  • 楼主hhy2023
  • 当前回复6
  • 已保存回复6
  • 发布时间2023/3/4 10:52
  • 上次更新2023/10/23 23:10:36
查看原帖
P8813!!!
932805
hhy2023楼主2023/3/4 10:52

PAC 80分!

#include<bits/stdc++.h>
using namespace std;
int c(int x, int n){
    int v=1;
    while(n--){
        v*=x;
    }
    return v;
}
int main(){
    long long a,b;
    cin>>a>>b;
    long long s=0;
    if(a+b>19){
        cout<<-1;
        return 0;
    }
    printf("%d",c(a,b));
    return 0;
}
2023/3/4 10:52
加载中...