Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int Number(int num)
- {
- int b = int.Parse(Console.ReadLine());
- for (int i = 0;i<b;i++)
- {
- num *= num;
- if (i==b)
- {
- break;
- }
- }
- return num;
- }
- static void Main(string[] args)
- {
- Console.Write("Введите число и его степень.");
- int a = int.Parse(Console.ReadLine());
- int c = Number(a);
- Console.Write($"Число A в степени B: {c}");
- Console.Read();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement