Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program {
- static void Main() {
- int n, div = 2;
- bool isFirst = true;
- Console.Write("Введіть число: ");
- n = int.Parse(Console.ReadLine());
- while (n > 1)
- {
- while (n % div == 0)
- {
- if(!isFirst)
- {
- Console.Write($"* ");
- }
- isFirst = false;
- Console.Write($"{div} ");
- n = n / div;
- }
- div++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement