язык с++
Объяснение:
#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "ru");
int number[15] = {4,6,8,10,12,14,16,18,20,22,24,26,28,30,32 };
cin >> number[0];
printf("%d\n", number[0]);
printf("%d\n", number[1]);
printf("%d\n", number[2]);
printf("%d\n", number[3]);
printf("%d\n", number[4]);
printf("%d\n", number[5]);
printf("%d\n", number[6]);
printf("%d\n", number[7]);
printf("%d\n", number[8]);
printf("%d\n", number[9]);
printf("%d\n", number[10]);
printf("%d\n", number[11]);
printf("%d\n", number[12]);
printf("%d\n", number[13]);
printf("%d\n", number[14]);
system("pause");
}
using System;
class Program
{
static void Main()
{
int x1 = 2, y1 = 1;
int x2 = 6, y2 = 5;
int x3 = 10, y3 = 1;
var a = Distance(x2, y2, x3, y3);
var b = Distance(x1, y1, x3, y3);
var c = Distance(x2, y2, x1, y1);
Console.WriteLine("S = {0}", Square(a, b, c));
Console.ReadKey();
}
//растояние между точками
static double Distance(int x1, int y1, int x2, int y2)
{
return Math.Sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
//формула герона
static double Square(double a, double b, double c)
{
var p = (a + b + c) / 2;
return Math.Sqrt(p * (p - a) * (p - b) * (p - c));
}
// теорема косинусов
static double Angle(double a, double b, double c)
{
return Math.Acos((b * b + c * c - a * a) / (2 * b * c));
}
static bool IsAcuteAngel(double alpha)
{
return alpha < Math.PI / 2;
}
}
язык с++
Объяснение:
#include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL, "ru");
int number[15] = {4,6,8,10,12,14,16,18,20,22,24,26,28,30,32 };
cin >> number[0];
printf("%d\n", number[0]);
printf("%d\n", number[1]);
printf("%d\n", number[2]);
printf("%d\n", number[3]);
printf("%d\n", number[4]);
printf("%d\n", number[5]);
printf("%d\n", number[6]);
printf("%d\n", number[7]);
printf("%d\n", number[8]);
printf("%d\n", number[9]);
printf("%d\n", number[10]);
printf("%d\n", number[11]);
printf("%d\n", number[12]);
printf("%d\n", number[13]);
printf("%d\n", number[14]);
system("pause");
}