(int i = 0; i
{[i] = 1.4 * i + tan (i - 5.5); <
} <
{[i] = 8.5 * i + tan (i + 3.9); <
} <
{[i] = 2.9 * i - tan (i + 1.7); <
} <
} Calc (double a [], int n)
{pos = 0; (int i = 0; i 0) + +; pr = 1, summa = 0; (pos> n/2)
{(int i = 0; i 0) * = a [i]; pr;
} (int i = 0; i
return summa;
}
Малюнок А.5 - Програмна реалізація рішення задачі № 5
# include В«stdafx.hВ»
# include
// Колір для виведення графіка
# define Red RGB (255,0,0)
# define Blue RGB (0,0,255)
// дескриптор вікна консолі
static HWND hWnd; GetConsoleWndHandle (void); Paint (int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); Draw_Ellipce (HWND Wnd, int x1, int y1, int x2, int y2, int Pen, HDC DrawHDC = 0); Draw_Rect (HWND Wnd, int x1, int y1, int x2, int y2, int Pen, HDC DrawHDC = 0); _tmain (int argc, _TCHAR * argv [])
{(10, 10, 10,10); 0;
} Paint (int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)
{= GetConsoleWndHandle (); _Rect (hWnd, 450, 50, 250, 150, Red); _Ellipce (hWnd, 350, 200, 250, 100, Blue); ();
} Draw_Ellipce (HWND Wnd, int x1, int y1, int x2, int y2, int Pen, HDC DrawHDC)
{hOPen; hNPen = CreatePen (PS_SOLID, 2, Pen); (! DrawHDC) DrawHDC = GetDC (Wnd); = (HPEN) SelectObject (DrawHDC, hNPen); (DrawHDC, x1, y1 , x2, y2); (SelectObject (DrawHDC, hOPen)); 0;
} Draw_Rect (HWND Wnd, int x1, int y1, int x2, int y2, int Pen, HDC DrawHDC)
{hOPen; hNPen = CreatePen (PS_SOLID, 2, Pen); (! DrawHDC) DrawHDC = GetDC (Wnd); = (HPEN) SelectObject (DrawHDC, hNPen); rect;. bottom = x2 ;. left = x1;. right = y2;. top = y1; (DrawHDC, & rect, (HBRUSH) (COLOR_WINDOW +1)); (SelectObject (DrawHDC, hOPen)); 0;
} GetConsoleWndHandle (void)
{hConWnd; os; szTempTitle [64], szClassName [128], szOriginalTitle [1024];. dwOSVersionInfoSize = sizeof (OSVERSIONINFO); (& os); (os.dwPlatformId == VER_PLATFORM_WIN32s) return 0; ((LPWSTR...