Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Ijunior
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Random random = new Random();
- int minRandomNumber = 10;
- int maxRandomNumber = 101;
- int randomNumber = random.Next(minRandomNumber, maxRandomNumber);
- int number = 2;
- int degreeOfNumber = 0;
- int sum = 1;
- for (int i = 1; sum <= randomNumber; i++)
- {
- sum *= number;
- degreeOfNumber = i;
- }
- Console.WriteLine($"{number} в степени {degreeOfNumber}, минимально первосходящее число {randomNumber}, равна {sum}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement