Last active
October 18, 2022 12:37
-
-
Save Velsimir/805420f861034a27bfa367be19ddd935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Policy; | |
using System.Threading; | |
namespace iJunior | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
Random random = new Random(); | |
int originalNumber = random.Next(0, 100); | |
int numberRaisedToPower = 1; | |
int degree = 2; | |
int numberInPower = 0; | |
bool isWorking = true; | |
while (isWorking) | |
{ | |
if (originalNumber>numberRaisedToPower) | |
{ | |
numberRaisedToPower *= degree; | |
numberInPower += 1; | |
} | |
else | |
{ | |
isWorking = false; | |
} | |
} | |
Console.WriteLine($"Изначальное число - {originalNumber}" + | |
$"\nСтеперь - {numberInPower}" + | |
$"\nЧисло в найденной степени - {numberRaisedToPower} "); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment