#include
#include
#include
#include
#include
#include
#include
typedef float* mass;
void GPS(int x, int y)
{
COORD Gon = { x, y };
HANDLE hwD = GetStdHandle(STD_OUTPUT_HANDLE);
//HANDLE - полчаем адрес консоли в системе для дальнейшего использования
SetConsoleCursorPosition(hwD, Gon);
}
int menu();
void setcolor(int text, int background)
{
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
//HANDLE - получаем адрес консоли в системе для дальнейшего использования
SetConsoleTextAttribute(hStdOut, (WORD)((background << 0) | text));
//Задание цвета
}
int intro()
{
int main();
system("cls");
int k[4] = { 100, 100, 300, 200 };
int red, green, blue, i, j;
red = rand();
green = rand();
blue = rand();
for (i = 0; i < 95; i++)
{
HDC hdc = GetDC(GetConsoleWindow());
HBRUSH Pen = CreateSolidBrush(RGB(red, green, blue));
SelectObject(hdc, Pen);
Rectangle(hdc, k[1], k[2], k[3], k[4]);
red = rand();
green = rand();
blue = rand();
if (i == 40)
for (int i = 0; i < 100; i++)
{
RoundRect(hdc, k[1], k[3], k[2], k[1], 160, 20);
red = rand();
green = rand() % 100;
blue = rand();
k[0] += (0.3*i);
k[2] -= (0.1*i);
Sleep(50);
}
if (i == 25)
for (int i = 0; i < 100; i++)
{
RoundRect(hdc, k[1], k[3], k[2], k[1], 100, 50);
Rectangle(hdc, k[1], k[0], k[0], k[0]);
red = rand() % 300;
green = rand();
blue = rand() % 400;
k[0] += (0.1*i);
k[1] += (0.1*i);
Sleep(10);
}
Rectangle(hdc, k[0], k[3], 150, 150); Rectangle(hdc, k[1], k[3], 150, 150);
k[0] += (0.1*i);
k[1] -= (0.1*i);
k[3] += (0.2*i);
Sleep(50);
}
system("cls");
return main();
}
int table()
{
int main();
system("cls");
setlocale(LC_ALL, "rus");
float F1[12];
float F2[12];
int i, a = 1, b = 3, n = 12;
float x, dx, minF1, minF2, maxF1, maxF2;
dx = 1.0*(b - a) / (n - 1);
x = a;
printf("----------------------------------- ");
printf("| i | x | F1 | F2 | ");
printf("----------------------------------- ");
for (i = 1; i <= n; ++i)
{
F1 = sqrt(exp(x) - 1);
F2 = x*pow(log(x), 2);
printf("| %3d | %5.2f | %8.6f | %3.6f| ", i, x, F1, F2);
minF1 = F1[1]; minF2 = F2[1]; maxF1 = F1[1]; maxF2 = F2[1];
if (F1 < minF1) minF1 = F1;
if (F2 < minF2) minF2 = F2;
if (F1 > maxF1) maxF1 = F1;
if (F2 > maxF2) maxF2 = F2;
x += dx;
}
printf("----------------------------------- ");
printf("min. F1 = %f, min. F2 = %f ", minF1, minF2);
printf("max. F1 = %f, max. F2 = %f ", maxF1, maxF2);
system("pause");
system("cls");
return main();
}
int grafiks()
{
system("color 0");
setlocale(LC_ALL, "RUS");
int main();
double x[12];
double y1[12], y2[12];
double a = 1;
setcolor(12, 0);
GPS(10, 18);
printf("красный график соответствует функции y = sqrt(exp(x) - 1) ");
setcolor(10, 0);
GPS(10, 20);
printf("зеленый график соответствует функции y =x*pow(log(x),2) ");
setcolor(6, 0);
for (int k = 0; k < 12; k++)
{
x[k] = a;
a += 0.17;
y1[k] = sqrt(exp(x[k]) - 1);
y2[k] = x[k] * pow(log(x[k]), 2);
}
HWND hwnd = GetConsoleWindow();
HDC hdc = GetDC(hwnd);
HPEN hpen1, hpen2;
HGDIOBJ hpenOld;
hpen1 = CreatePen(PS_SOLID, 2, RGB(255, 255, 255));
hpenOld = (HPEN)SelectObject(hdc, hpen1);
MoveToEx(hdc, 100, 135, NULL);
LineTo(hdc, 360, 135);
MoveToEx(hdc, 230, 10, NULL);
LineTo(hdc, 230, 260);
MoveToEx(hdc, 230, 10, NULL);
LineTo(hdc, 224, 20);
MoveToEx(hdc, 230, 10, NULL);
LineTo(hdc, 235, 20);
MoveToEx(hdc, 360, 135, NULL);
LineTo(hdc, 350,
#include
#include
#include
#include
#include
#include
typedef float* mass;
void GPS(int x, int y)
{
COORD Gon = { x, y };
HANDLE hwD = GetStdHandle(STD_OUTPUT_HANDLE);
//HANDLE - полчаем адрес консоли в системе для дальнейшего использования
SetConsoleCursorPosition(hwD, Gon);
}
int menu();
void setcolor(int text, int background)
{
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
//HANDLE - получаем адрес консоли в системе для дальнейшего использования
SetConsoleTextAttribute(hStdOut, (WORD)((background << 0) | text));
//Задание цвета
}
int intro()
{
int main();
system("cls");
int k[4] = { 100, 100, 300, 200 };
int red, green, blue, i, j;
red = rand();
green = rand();
blue = rand();
for (i = 0; i < 95; i++)
{
HDC hdc = GetDC(GetConsoleWindow());
HBRUSH Pen = CreateSolidBrush(RGB(red, green, blue));
SelectObject(hdc, Pen);
Rectangle(hdc, k[1], k[2], k[3], k[4]);
red = rand();
green = rand();
blue = rand();
if (i == 40)
for (int i = 0; i < 100; i++)
{
RoundRect(hdc, k[1], k[3], k[2], k[1], 160, 20);
red = rand();
green = rand() % 100;
blue = rand();
k[0] += (0.3*i);
k[2] -= (0.1*i);
Sleep(50);
}
if (i == 25)
for (int i = 0; i < 100; i++)
{
RoundRect(hdc, k[1], k[3], k[2], k[1], 100, 50);
Rectangle(hdc, k[1], k[0], k[0], k[0]);
red = rand() % 300;
green = rand();
blue = rand() % 400;
k[0] += (0.1*i);
k[1] += (0.1*i);
Sleep(10);
}
Rectangle(hdc, k[0], k[3], 150, 150); Rectangle(hdc, k[1], k[3], 150, 150);
k[0] += (0.1*i);
k[1] -= (0.1*i);
k[3] += (0.2*i);
Sleep(50);
}
system("cls");
return main();
}
int table()
{
int main();
system("cls");
setlocale(LC_ALL, "rus");
float F1[12];
float F2[12];
int i, a = 1, b = 3, n = 12;
float x, dx, minF1, minF2, maxF1, maxF2;
dx = 1.0*(b - a) / (n - 1);
x = a;
printf("----------------------------------- ");
printf("| i | x | F1 | F2 | ");
printf("----------------------------------- ");
for (i = 1; i <= n; ++i)
{
F1 = sqrt(exp(x) - 1);
F2 = x*pow(log(x), 2);
printf("| %3d | %5.2f | %8.6f | %3.6f| ", i, x, F1, F2);
minF1 = F1[1]; minF2 = F2[1]; maxF1 = F1[1]; maxF2 = F2[1];
if (F1 < minF1) minF1 = F1;
if (F2 < minF2) minF2 = F2;
if (F1 > maxF1) maxF1 = F1;
if (F2 > maxF2) maxF2 = F2;
x += dx;
}
printf("----------------------------------- ");
printf("min. F1 = %f, min. F2 = %f ", minF1, minF2);
printf("max. F1 = %f, max. F2 = %f ", maxF1, maxF2);
system("pause");
system("cls");
return main();
}
int grafiks()
{
system("color 0");
setlocale(LC_ALL, "RUS");
int main();
double x[12];
double y1[12], y2[12];
double a = 1;
setcolor(12, 0);
GPS(10, 18);
printf("красный график соответствует функции y = sqrt(exp(x) - 1) ");
setcolor(10, 0);
GPS(10, 20);
printf("зеленый график соответствует функции y =x*pow(log(x),2) ");
setcolor(6, 0);
for (int k = 0; k < 12; k++)
{
x[k] = a;
a += 0.17;
y1[k] = sqrt(exp(x[k]) - 1);
y2[k] = x[k] * pow(log(x[k]), 2);
}
HWND hwnd = GetConsoleWindow();
HDC hdc = GetDC(hwnd);
HPEN hpen1, hpen2;
HGDIOBJ hpenOld;
hpen1 = CreatePen(PS_SOLID, 2, RGB(255, 255, 255));
hpenOld = (HPEN)SelectObject(hdc, hpen1);
MoveToEx(hdc, 100, 135, NULL);
LineTo(hdc, 360, 135);
MoveToEx(hdc, 230, 10, NULL);
LineTo(hdc, 230, 260);
MoveToEx(hdc, 230, 10, NULL);
LineTo(hdc, 224, 20);
MoveToEx(hdc, 230, 10, NULL);
LineTo(hdc, 235, 20);
MoveToEx(hdc, 360, 135, NULL);
LineTo(hdc, 350,