Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication12
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i, mone = 1, mone2 = 0;
- for (i = 100; i < 1000000; i++)
- {
- for (; mone <= (i / 2); mone = 1, mone2 = 0)
- {
- if (i % mone == 0)
- {
- mone2 = mone2 + mone;
- mone++;
- }
- if (mone2 == i)
- {
- Console.WriteLine(mone2 + " Perfect number!");
- }
- }
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment