Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- int N, i;
- int Sum = 0;
- cout << "Введите число N " << endl ;
- cin >> N;
- for (i = 1; i < N; i++)
- {
- if (N % i == 0)
- {
- Sum += i;
- }
- }
- if (Sum == N)
- {
- cout << "Да. Это число совершенное " << endl;
- }
- else
- {
- cout << "Нет . Это число не совершенное" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment