# 1134. Armstrong Number ###### tags: `Leetcode` `Easy` ## Code ```java= class Solution { public boolean isArmstrong(int n) { String tmp = String.valueOf(n); int k = tmp.length(); int sum = 0, x = n; while(x>0){ sum += (int)Math.pow(x%10, k); x/=10; if(sum>n) return false; } return sum==n; } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up