بسم الله الرحمن الرحيم
هلا
شخباركم
بغيت منكم اساعدوني وشوفوا لي شنو الخطا اللي سويته مو عارفة بالضبط
تعبت وانا احاول فيه
هذا السؤال
Suppose that m and n are integers and m is nonzero. Recall that m is called a divisor of n if n = mt for some integer t; that is, when m divides n, the reminder is 0. Moreover, m is called a proper devisor of n if m < n and m divides n. A positive integer is called perfect if it is the sum of its positive proper devisors.
For example, the positive proper devisors of 28 are 1, 2, 4, 7 and 14 and 1+ 2 + 4 + 7 + 14 = 28, therefore, 28 is perfect.
Write a program that takes as input a positive integer and then outputs whether the integer is perfect.
وهذا اللي كتبته
#include <iostream>
using namespace std;
int main()
{
int m,n,t,sum;
cin>>n;
cout<<"the positive proper devisors of:"<<endl;
cout<<"are"<<endl;
for(m=1;m=n-1;m++)
n=m*t;
m<n;
n%=m;
m=0;
cout<<n<<endl;
n=sum;
cout<<"perfect"<<endl;
return 0;
}
مشكورين مقدما