Advertisement
Guest User

Untitled

a guest
Sep 17th, 2020
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2.  
  3. namespace PrimeFactors2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int num = int.Parse(Console.ReadLine());
  10.             for (int i = 2; i <= num; i++)
  11.             {
  12.                 while (num % i == 0)
  13.                 {
  14.                     num /= i;
  15.                     Console.WriteLine(i);
  16.  
  17.                 }
  18.             }
  19.         }
  20.     }
  21. }
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement