求条,悬二关,P8379
查看原帖
求条,悬二关,P8379
1272608
ToMaT楼主2024/8/3 08:05
#include<bits/stdc++.h>
using namespace std;
int main(){
    signed long long a,n;
    cin>>a>>n;
    long long A=0,B=0;
    signed long long cnt=pow(a,n);
    while(cnt!=0){
    	if(cnt%10%2==0){
    		B++;
		}
		else{
			A++;
		}
		cnt/=10;
	}
	cout<<A-B;
   	return 0;
}
2024/8/3 08:05
加载中...