Advertisement
IGRODELOFF

Task18

Mar 18th, 2022
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Task18
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Random random = new Random();
  14.  
  15.             int randomMin = 0;
  16.             int randomMax = 101;
  17.             int number = random.Next(randomMin,randomMax);
  18.             int numberDegreeStartValue = 2;
  19.             int degree = 0;
  20.             int numberDegreeValue = 1;
  21.  
  22.             Console.WriteLine("Заданное число - " + number);
  23.  
  24.             while (number > numberDegreeValue)
  25.             {
  26.                 degree++;
  27.                 numberDegreeValue *= numberDegreeStartValue;
  28.                 Console.WriteLine(degree + " " + numberDegreeValue);
  29.             }
  30.         }
  31.     }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement