A. PERFECT NUMBER PROBLEM(南昌网络赛)

Write a program to output the first 55 perfect numbers. A perfect number is defined to be a positive integer where the sum of its positive integer divisors excluding the number itself equals the number.

For example: 1+ 2 + 3 = 61+2+3=6, and 66 is the firsht perfect number.

There is no input for this problem.

题意是要求求出前五个等于其因子除本身外相加之和的数。

打表找到。

#include<set>
#include<map>
#include<cmath>
#include<vector>
#include<cstdio>
#include<string>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
printf("6\n28\n496\n8128\n33550336\n");
return 0;
}

猜你喜欢

转载自blog.csdn.net/shinian_acmer/article/details/89428508