using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
static void Main(string[] args)
double x1, x2, x3, y1, y2, y3;
Console.WriteLine("Введите координаты:");
x1 = Double.Parse(Console.ReadLine());
y1 = Double.Parse(Console.ReadLine());
x2 = Double.Parse(Console.ReadLine());
y2 = Double.Parse(Console.ReadLine());
x3 = Double.Parse(Console.ReadLine());
y3 = Double.Parse(Console.ReadLine());
double dist12 = Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));
double dist13 = Math.Sqrt(Math.Pow((x3 - x1), 2) + Math.Pow((y3 - y1), 2));
double dist23 = Math.Sqrt(Math.Pow((x3 - x2), 2) + Math.Pow((y3 - y2), 2));
double P = dist12 + dist13 + dist23;
double p = P / 2;
double Area = p * (p - dist12) * (p - dist13) * (p - dist23);
Console.WriteLine("Площадь {0}", Area);
Console.ReadKey();
}
n = int(
lstr = (" ")
ns = []
i = 0
tot = 0
while i < n:
ns.append(int(
tot += int(lstr[i])
i += 1
if tot % 5 == 0 and len(ns) > 4:
sm = int(tot / 5)
ns = sorted(ns, reverse=true)
ps = "yes"
su = 0
sk = 0
b = false
for n in ns:
if n ! = 0 and b:
su == 0
sk += 1
break
if sk == 5:
ps = "no"
su += n
if abs(su) > abs(sm):
if su == sm:
b = true
print(ps)
else:
print("no")
СДЕЛАЙ ОТВЕТ ЛУЧШИМ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
double x1, x2, x3, y1, y2, y3;
Console.WriteLine("Введите координаты:");
x1 = Double.Parse(Console.ReadLine());
y1 = Double.Parse(Console.ReadLine());
x2 = Double.Parse(Console.ReadLine());
y2 = Double.Parse(Console.ReadLine());
x3 = Double.Parse(Console.ReadLine());
y3 = Double.Parse(Console.ReadLine());
double dist12 = Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));
double dist13 = Math.Sqrt(Math.Pow((x3 - x1), 2) + Math.Pow((y3 - y1), 2));
double dist23 = Math.Sqrt(Math.Pow((x3 - x2), 2) + Math.Pow((y3 - y2), 2));
double P = dist12 + dist13 + dist23;
double p = P / 2;
double Area = p * (p - dist12) * (p - dist13) * (p - dist23);
Console.WriteLine("Площадь {0}", Area);
Console.ReadKey();
}
}
}
n = int(
lstr = (" ")
ns = []
i = 0
tot = 0
while i < n:
ns.append(int(
tot += int(lstr[i])
i += 1
if tot % 5 == 0 and len(ns) > 4:
sm = int(tot / 5)
ns = sorted(ns, reverse=true)
ps = "yes"
su = 0
sk = 0
b = false
for n in ns:
if n ! = 0 and b:
su == 0
sk += 1
b = false
break
if sk == 5:
ps = "no"
break
su += n
if abs(su) > abs(sm):
ps = "no"
break
if su == sm:
b = true
print(ps)
else:
print("no")
СДЕЛАЙ ОТВЕТ ЛУЧШИМ