MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / Arms

Method Arms

Java/Armstrong.java:4–15  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

2* Example 153 = 1^3 + 5^3 + 3^3 = 153 */
3public class Armstrong {
4 static boolean Arms(int n){
5 int org=n;
6 int ans = 0;
7 while(n>0){
8 int rem=n%10;
9
10 ans+=rem*rem*rem;
11 n/=10;
12 }
13 return org==ans;
14
15 }
16 public static void main(String[] args) {
17
18 for (int i=100;i<1000;i++){

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected