Написать названия 8-10 графических примитивов Написать какие действия можно выполнять для форматирования примитива (Например: изменение размера, поворот …)
OPTION BASE 1 DIM a(10) AS SINGLE, b(10) AS SINGLE, x(10) AS SINGLE RANDOMIZE TIMER FOR i = 1 TO 10 a(i) = 30 * RND - 15 NEXT i FOR i = 1 TO 10 b(i) = 40 * RND - 20 NEXT i CLS PRINT "A", "B", "X" FOR i = 1 TO 10 IF a(i) = 0 THEN x(i) = 1E+10 ELSE x(i) = b(i) / a(i) END IF PRINT a(i), b(i), x(i) NEXT i
#include <iostream>
#include <cmath>
struct coord
{
double x;
double y;
};
using namespace std;
void TriangleExist(coord a, coord b, coord c)
{
double modAB = sqrt(pow((a.x-b.x),2)+pow((a.y-b.y),2));
double modAC = sqrt(pow((a.x-c.x),2)+pow((a.y-c.y),2));
double modBC = sqrt(pow((b.x-c.x),2)+pow((b.y-c.y),2));
if (modAB+modAC <= modBC)
cout << "Do not exist" << endl;
else if (modAC + modBC <= modAB)
cout << "Do not exist" << endl;
else if (modAB+modBC <= modAC)
cout << "Do not exist" << endl;
else
cout << "Exist" << endl;
}
int main()
{
coord A, B, C;
cin >> A.x >> A.y;
cin >> B.x >> B.y;
cin >> C.x >> C.y;
TriangleExist(A, B, C);
system("pause");
exit(0);
return 0;
}
Еще с чистым мейном.
#include <iostream>
#include <conio.h>
#include <cmath> //математическая библия, ну очень облегчает задачу :)))
using namespace std;
void main(void)
{
double Ax, Ay, Bx, By, Cx, Cy;
cin >> Ax >> Ay >> Bx >> By >> Cx >> Cy;
double modAB = sqrt(pow((Ax-Bx),2)+pow((Ay-By),2));
double modAC = sqrt(pow((Ax-Cx),2)+pow((Ay-Cy),2));
double modBC = sqrt(pow((Bx-Cx),2)+pow((By-Cy),2));
if (modAB+modAC <= modBC)
cout << "Do not exist" << endl;
else if (modAC + modBC <= modAB)
cout << "Do not exist" << endl;
else if (modAB+modBC <= modAC)
cout << "Do not exist" << endl;
else
cout << "Exist" << endl;
_getch();
return;
}