If the resultant of adding the encrypted number and number entered by a terrorist is a perfect number, then print "They can read the message". Otherwise, print "They can't read the message".
Answers
Answered by
2
Answer:
#include<iostream>
using namespace std;
int main()
{
int a,b,c,n,sum=0;
cin>>a;
cin>>b;
n=a+b;
for(int i=1;i<n;i++)
{
c=n%i;
if(c==0)
{
sum=sum+i;
}
}
if(sum==n)
{
cout<<"They can read the message";
}
else
{
cout<<"They can't read the message";
}
return 0;
}
Similar questions
Math,
4 months ago
Science,
4 months ago
Social Sciences,
4 months ago
Science,
9 months ago
Environmental Sciences,
9 months ago
Social Sciences,
1 year ago