Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp27
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите длины сторон треугольника: ");
- string aInput = Console.ReadLine();
- string bInput = Console.ReadLine();
- string cInput = Console.ReadLine();
- int a, b, c;
- if (int.TryParse(aInput,out a)
- && int.TryParse(bInput, out b)
- && int.TryParse(cInput, out c))
- Perimeter(a,b,c);
- else
- Console.WriteLine("Ошибка ввода!");
- }
- private static void Perimeter(int a, int b, int c)
- {
- int perimeter = a + b + c;
- Console.WriteLine($"Периметр: {perimeter}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment