Why did the case failed , i checked for multiple custom inputs as well

#include
#include<math.h>
using namespace std;
int primesum(int n){
int p=0;
while(n%2==0){
p+=2;
n=n/2;
}
for(int i=3;i<=sqrt(n);i+=2){
while(n%i==0){
p+=i;
n=n/i;
}
}if(n>2){
p+=n;
}
return p;
}
void boston(int n){
int no=n;
int pn=n;
int sum=0;
while(no>0){
int temp=no%10;
sum+=temp;
no=no/10;
}
int sump;
int pf;
for(int i=2;i<n;i++){
if(n%i!=0){
pf=i;
n=n/pf;
}
}
sump=primesum(pn);
if(sump==sum){
cout<<β€œ1”;
}else
cout<<β€œ0”;
}
int main() {
int n;
cin>>n;

boston(n);
return 0;

}

hi @rounaqkhandelwal24
I can see that u have successfully submitted the code and gained full points… is there still anything???

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.