Test case failing
4 test case is failing
Sorry there were unnecessary lines at the bottom which must have thrown compilation error, try this code https://ide.codingblocks.com/s/328662
I think you send the wrong code
I don’t know how it got edited. This is the link https://ide.codingblocks.com/s/328830
and this is the code actually , if again the link gets edited.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int len=0;
int digit=0;
int armsstrong=n;
int temp = n;
while(temp>0){
len++;
temp=temp/10;
}
while(n){
int lastdigit=n%10;
int no=pow(lastdigit,len);
digit=no+digit;
n=n/10;
}
// cout<<digit<<endl;
if(digit==armsstrong){
cout<<"true";
}
if(digit!=armsstrong){
cout<<"false";
}
}
kindl check (run)your your code ,only 4 testcase is passing