mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
归类了 OJ,整理了一下
This commit is contained in:
27
XSM OJ 重庆小码王集团OJ/自幂数.cpp
Normal file
27
XSM OJ 重庆小码王集团OJ/自幂数.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
int main(){
|
||||
long long a,b=0,c[10000],d,sum=0;
|
||||
scanf("%lld",&a);
|
||||
d=a;
|
||||
while(d){
|
||||
c[b]=d%10;
|
||||
b++;
|
||||
d/=10;
|
||||
}
|
||||
for(int i=0;i<b;i++){
|
||||
sum+=pow(c[i],b);
|
||||
}
|
||||
if(sum==a){
|
||||
printf("Yes");
|
||||
}
|
||||
else{
|
||||
printf("No");
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user