Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace COD
- {
- class Program
- {
- static void Main(string[] args)
- {
- Body: for (;;)
- {
- System.Console.Clear();
- Console.Title = "Calculation of the degrees by Festelo.";
- Console.WriteLine("Возведение в степень.\nВведите данные в консоль: *число* *степень*.\nПример: 1,2 5");
- string[] STOut = Console.ReadLine().Replace('.', ',').Split(' ');
- double[] num = { 1, 1 };
- int one = 0;
- try
- {
- for (int i = 0; i <= 1; i++)
- {
- if (!double.TryParse(STOut[one], out num[one])) break;
- one++;
- }
- }
- catch { goto Body; }
- double result = System.Math.Pow(num[0], num[1]);
- Console.WriteLine("Ответ: " + result);
- Console.ReadKey();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment