Добавьте файлы проекта.
341
11/11.cpp
Normal file
@ -0,0 +1,341 @@
|
||||
// 11.cpp : Определяет точку входа для приложения.
|
||||
//
|
||||
|
||||
#include "stdio.h"
|
||||
#include "framework.h"
|
||||
#include "11.h"
|
||||
#include "time.h"
|
||||
|
||||
|
||||
//TODO: мои зависимости
|
||||
#include "Function.h"
|
||||
enum images image_now = (enum images)0;
|
||||
|
||||
COLORREF colors1[9] = {
|
||||
RGB(255,0,0),
|
||||
RGB(255,127,0),
|
||||
RGB(255,255,0),
|
||||
RGB(127,255,0),
|
||||
RGB(0,255,0),
|
||||
RGB(0,255,127),
|
||||
RGB(0,255,255),
|
||||
RGB(0,127,255),
|
||||
RGB(0,0,255),
|
||||
};
|
||||
|
||||
#define L12
|
||||
const int v = 10;
|
||||
|
||||
IMAGE img = { 20,20,v,v,RGB(255,0,255),arrow };
|
||||
|
||||
IMAGE imgs[4] = {
|
||||
{ 420,220,v,0,RGB(0,0,0),triangle },
|
||||
{ 420,220,-v,0,RGB(255,0,0),diamond },
|
||||
{ 420,220,0,v,RGB(0,0,255),crown },
|
||||
{ 420,220,0,-v,RGB(0,255,0),flag },
|
||||
};
|
||||
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
// Глобальные переменные:
|
||||
HINSTANCE hInst; // текущий экземпляр
|
||||
WCHAR szTitle[MAX_LOADSTRING]; // Текст строки заголовка
|
||||
WCHAR szWindowClass[MAX_LOADSTRING]; // имя класса главного окна
|
||||
|
||||
// Отправить объявления функций, включенных в этот модуль кода:
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
// TODO: Разместите код здесь.
|
||||
|
||||
// Инициализация глобальных строк
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_MY1112, szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Выполнить инициализацию приложения:
|
||||
if (!InitInstance (hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MY1112));
|
||||
|
||||
MSG msg;
|
||||
|
||||
// Цикл основного сообщения:
|
||||
while (GetMessage(&msg, nullptr, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: MyRegisterClass()
|
||||
//
|
||||
// ЦЕЛЬ: Регистрирует класс окна.
|
||||
//
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASSEXW wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
|
||||
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wcex.lpfnWndProc = WndProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MY1112));
|
||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_MY1112);
|
||||
wcex.lpszClassName = szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
|
||||
return RegisterClassExW(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: InitInstance(HINSTANCE, int)
|
||||
//
|
||||
// ЦЕЛЬ: Сохраняет маркер экземпляра и создает главное окно
|
||||
//
|
||||
// КОММЕНТАРИИ:
|
||||
//
|
||||
// В этой функции маркер экземпляра сохраняется в глобальной переменной, а также
|
||||
// создается и выводится главное окно программы.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Сохранить маркер экземпляра в глобальной переменной
|
||||
|
||||
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
|
||||
|
||||
if (!hWnd)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
//
|
||||
// ЦЕЛЬ: Обрабатывает сообщения в главном окне.
|
||||
//
|
||||
// WM_COMMAND - обработать меню приложения
|
||||
// WM_PAINT - Отрисовка главного окна
|
||||
// WM_DESTROY - отправить сообщение о выходе и вернуться
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
{
|
||||
int wmId = LOWORD(wParam);
|
||||
// Разобрать выбор в меню:
|
||||
switch (wmId)
|
||||
{
|
||||
case IDM_ABOUT:
|
||||
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
|
||||
break;
|
||||
case IDM_EXIT:
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hWnd, &ps);
|
||||
// TODO: Добавьте сюда любой код прорисовки, использующий HDC...
|
||||
|
||||
#ifndef L12
|
||||
void (*d[5])(HDC, int, int, COLORREF) = {
|
||||
triangle,
|
||||
arrow,
|
||||
diamond,
|
||||
flag,
|
||||
crown
|
||||
};
|
||||
|
||||
pattern1(hdc, (*d[image_now]));
|
||||
#endif
|
||||
|
||||
#ifdef L12
|
||||
img.func(hdc, img.x, img.y, img.color);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
imgs[i].func(hdc, imgs[i].x, imgs[i].y, imgs[i].color);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef L12
|
||||
case WM_CREATE:
|
||||
SetTimer(hWnd, 1, 40, 0);
|
||||
SetTimer(hWnd, 2, 100, 0);
|
||||
srand(time(NULL));
|
||||
break;
|
||||
case WM_TIMER:
|
||||
|
||||
switch (wParam) {
|
||||
case 1:
|
||||
RECT rect;
|
||||
|
||||
GetClientRect(hWnd, &rect);
|
||||
|
||||
if (img.x + 20 > rect.right) {
|
||||
img.vx = -v;
|
||||
}
|
||||
|
||||
if (img.x - 20 < rect.left) {
|
||||
img.vx = v;
|
||||
}
|
||||
|
||||
if (img.y + 20 > rect.bottom) {
|
||||
img.vy = -v;
|
||||
}
|
||||
|
||||
if (img.y - 20 < rect.top) {
|
||||
img.vy = v;
|
||||
}
|
||||
|
||||
img.x += img.vx;
|
||||
img.y += img.vy;
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (imgs[i].x + 20 > rect.right) {
|
||||
imgs[i].vx = -v;
|
||||
}
|
||||
|
||||
if (imgs[i].x - 20 < rect.left) {
|
||||
imgs[i].vx = v;
|
||||
}
|
||||
|
||||
if (imgs[i].y + 20 > rect.bottom) {
|
||||
imgs[i].vy = -v;
|
||||
}
|
||||
|
||||
if (imgs[i].y - 20 < rect.top) {
|
||||
imgs[i].vy = v;
|
||||
}
|
||||
|
||||
imgs[i].x += imgs[i].vx;
|
||||
imgs[i].y += imgs[i].vy;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
//img.color = colors1[rand() % 9];
|
||||
img.color = RGB(rand()%256, rand()%256, rand()%256);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
imgs[i].color = RGB(rand() % 256, rand() % 256, rand() % 256);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
case WM_KEYDOWN:
|
||||
switch (wParam)
|
||||
{
|
||||
case VK_RIGHT:
|
||||
image_now = (enum images)(image_now + 1);
|
||||
break;
|
||||
case VK_LEFT:
|
||||
image_now = (enum images)(image_now - 1);
|
||||
break;
|
||||
}
|
||||
#ifndef L12
|
||||
if (image_now > 4 ) {
|
||||
image_now = (enum images)0;
|
||||
}
|
||||
if (image_now < 0) {
|
||||
image_now = (enum images)3;
|
||||
}
|
||||
#endif
|
||||
#ifdef L12
|
||||
if (image_now > 8) {
|
||||
image_now = (enum images)0;
|
||||
}
|
||||
if (image_now < 0) {
|
||||
image_now = (enum images)8;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//RedrawWindow(hWnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
|
||||
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Обработчик сообщений для окна "О программе".
|
||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return (INT_PTR)TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
}
|
151
11/11.vcxproj
Normal file
@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{fd72aa5a-14f6-4851-83a9-b1d6948b0c86}</ProjectGuid>
|
||||
<RootNamespace>My1112</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>11</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="11.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Function.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="11.cpp" />
|
||||
<ClCompile Include="Function.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="11.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="11.ico" />
|
||||
<Image Include="small.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
55
11/11.vcxproj.filters
Normal file
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="11.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Function.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="11.cpp">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Function.cpp">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="11.rc">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="small.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
<Image Include="11.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
116
11/Function.cpp
Normal file
@ -0,0 +1,116 @@
|
||||
#include "Function.h"
|
||||
|
||||
void triangle(HDC hdc, int x, int y, COLORREF color) {
|
||||
HPEN hpen = CreatePen(PS_SOLID, 2, color);
|
||||
SelectObject(hdc, hpen);
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
|
||||
POINT pt[3] = {
|
||||
{x,y - 20},
|
||||
{x + 20,y + 20},
|
||||
{x - 20, y + 20}
|
||||
};
|
||||
|
||||
Polygon(hdc, pt, 3);
|
||||
|
||||
DeleteObject(hpen);
|
||||
SelectObject(hdc, GetStockObject(DC_PEN));
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void arrow(HDC hdc, int x, int y, COLORREF color) {
|
||||
HPEN hpen = CreatePen(PS_SOLID, 2, color);
|
||||
SelectObject(hdc, hpen);
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
|
||||
POINT pt[4] = {
|
||||
{x, y},
|
||||
{x + 20, y - 20},
|
||||
{x, y + 20},
|
||||
{x - 20, y - 20}
|
||||
};
|
||||
|
||||
Polygon(hdc, pt, 4);
|
||||
|
||||
DeleteObject(hpen);
|
||||
SelectObject(hdc, GetStockObject(DC_PEN));
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void diamond(HDC hdc, int x, int y, COLORREF color) {
|
||||
HPEN hpen = CreatePen(PS_SOLID, 2, color);
|
||||
SelectObject(hdc, hpen);
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
|
||||
POINT pt[4] = {
|
||||
{x, y - 20},
|
||||
{x + 20, y},
|
||||
{x, y + 20},
|
||||
{x - 20, y}
|
||||
};
|
||||
|
||||
Polygon(hdc, pt, 4);
|
||||
|
||||
DeleteObject(hpen);
|
||||
SelectObject(hdc, GetStockObject(DC_PEN));
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void flag(HDC hdc, int x, int y, COLORREF color) {
|
||||
HPEN hpen = CreatePen(PS_SOLID, 2, color);
|
||||
SelectObject(hdc, hpen);
|
||||
|
||||
POINT pt[6] = {
|
||||
{x - 20, y},
|
||||
{x + 20, y},
|
||||
{x, y - 10},
|
||||
{x + 20, y - 20},
|
||||
{x - 20, y - 20},
|
||||
{x - 20, y + 20}
|
||||
};
|
||||
|
||||
Polyline(hdc, pt, 6);
|
||||
|
||||
DeleteObject(hpen);
|
||||
SelectObject(hdc, GetStockObject(DC_PEN));
|
||||
}
|
||||
|
||||
void crown(HDC hdc, int x, int y, COLORREF color) {
|
||||
HPEN hpen = CreatePen(PS_SOLID, 2, color);
|
||||
SelectObject(hdc, hpen);
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
|
||||
POINT pt[5] = {
|
||||
{x, y},
|
||||
{x + 20, y - 20},
|
||||
{x + 20, y + 20},
|
||||
{x - 20, y + 20},
|
||||
{x - 20, y - 20},
|
||||
};
|
||||
|
||||
Polygon(hdc, pt, 5);
|
||||
|
||||
DeleteObject(hpen);
|
||||
SelectObject(hdc, GetStockObject(DC_PEN));
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void pattern1(HDC hdc, void (*f)(HDC, int, int, COLORREF)) {
|
||||
COLORREF colors[Length] = {
|
||||
RGB(255,0,0),
|
||||
RGB(0,255,0),
|
||||
RGB(0,0,255),
|
||||
RGB(255,0,255),
|
||||
RGB(255,255,0)
|
||||
};
|
||||
POINT pt[Length] = {
|
||||
{40,40},
|
||||
{240,40},
|
||||
{440,40},
|
||||
{40,240},
|
||||
{440,240}
|
||||
};
|
||||
for (int i = 0; i < Length; i++) {
|
||||
(*f)(hdc, pt[i].x, pt[i].y, colors[i]);
|
||||
}
|
||||
}
|
31
11/Function.h
Normal file
@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#define Length 5
|
||||
|
||||
enum images {
|
||||
i_triangle,
|
||||
i_arrow,
|
||||
i_diamond,
|
||||
i_flag,
|
||||
i_crown
|
||||
};
|
||||
|
||||
typedef struct Image_cords {
|
||||
int x;
|
||||
int y;
|
||||
int vx;
|
||||
int vy;
|
||||
COLORREF color;
|
||||
void (*func)(HDC, int, int, COLORREF);
|
||||
} IMAGE;
|
||||
|
||||
void triangle(HDC hdc, int x, int y, COLORREF color);
|
||||
void arrow(HDC hdc, int x, int y, COLORREF color);
|
||||
void diamond(HDC hdc, int x, int y, COLORREF color);
|
||||
void flag(HDC hdc, int x, int y, COLORREF color);
|
||||
void crown(HDC hdc, int x, int y, COLORREF color);
|
||||
|
||||
void pattern1(HDC hdc, void (*f)(HDC, int, int, COLORREF));
|
||||
|
30
11/Resource.h
Normal file
@ -0,0 +1,30 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Включаемый файл, созданный в Microsoft Visual C++.
|
||||
// Используется 11-12.rc
|
||||
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_MY1112_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_MY1112 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_MY1112 109
|
||||
#define IDC_MYICON 2
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
// Следующие стандартные значения для новых объектов
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NO_MFC 130
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
2
11/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
15
11/framework.h
Normal file
@ -0,0 +1,15 @@
|
||||
// header.h: включаемый файл для стандартных системных включаемых файлов
|
||||
// или включаемые файлы для конкретного проекта
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#define WIN32_LEAN_AND_MEAN // Исключите редко используемые компоненты из заголовков Windows
|
||||
// Файлы заголовков Windows
|
||||
#include <windows.h>
|
||||
// Файлы заголовков среды выполнения C
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
BIN
11/small.ico
Normal file
After Width: | Height: | Size: 45 KiB |
6
11/targetver.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// // При включении SDKDDKVer.h будет задана самая новая из доступных платформ Windows.
|
||||
// Если вы планируете сборку приложения для предыдущей версии платформы Windows, включите WinSDKVer.h и
|
||||
// задайте желаемую платформу в макросе _WIN32_WINNT, прежде чем включать SDKDDKVer.h.
|
||||
#include <SDKDDKVer.h>
|
139
13-14/13-14.vcxproj
Normal file
@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{161816fb-da2b-43f7-8cfe-2f3a03bf2f97}</ProjectGuid>
|
||||
<RootNamespace>My1314</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Function.c" />
|
||||
<ClCompile Include="Main.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Function.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
30
13-14/13-14.vcxproj.filters
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Function.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Function.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
266
13-14/Function.c
Normal file
@ -0,0 +1,266 @@
|
||||
#include "Function.h"
|
||||
|
||||
int arr[DEFAULT_LENGHT];
|
||||
int lenght = 0;
|
||||
|
||||
Element getMax(), getMin();
|
||||
|
||||
//13
|
||||
void setArray() {
|
||||
printf("n = ");
|
||||
scanf_s("%d", &lenght);
|
||||
|
||||
printf("Ââåäèòå %d ÷èñåë: ", lenght);
|
||||
for (int i = 0; i < lenght; i++) {
|
||||
scanf_s("%d", &arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void oddX10() {
|
||||
for (int i = 0; i < lenght; i++) {
|
||||
if (arr[i] % 2 != 0) {
|
||||
arr[i] *= 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int countGreaterThen(int greater) {
|
||||
int k = 0;
|
||||
for (int i = 0; i < lenght; i++) {
|
||||
if (arr[i] > greater) {
|
||||
k++;
|
||||
}
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
void timesLastEven(int times) {
|
||||
for (int i = lenght-1; i >= 0; i--) {
|
||||
if (arr[i] % 2 == 0) {
|
||||
arr[i] *= times;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int countEvenLeftOfMin() {
|
||||
Element min = getMin();
|
||||
|
||||
int k = 0;
|
||||
for (int i = 0; i < min.index; i++) {
|
||||
if (arr[i] % 2 == 0) {
|
||||
k++;
|
||||
}
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
void timesOddRightOfMin(int times) {
|
||||
Element min = getMin();
|
||||
for (int i = min.index + 1; i < lenght; i++) {
|
||||
if (arr[i] % 2 != 0) {
|
||||
arr[i] *= times;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceMinMax() {
|
||||
Element minGet = getMin();
|
||||
Element maxGet = getMax();
|
||||
arr[minGet.index] = maxGet.value;
|
||||
arr[maxGet.index] = minGet.value;
|
||||
}
|
||||
|
||||
void allEven(int times) {
|
||||
for (int i = 0; i < lenght; i++) {
|
||||
if (arr[i] % 2 == 0) arr[i] *= times;
|
||||
}
|
||||
}
|
||||
|
||||
void allLess4() {
|
||||
for (int i = 0; i < lenght; i++) {
|
||||
if (arr[i] < 4) arr[i] = 4;
|
||||
}
|
||||
}
|
||||
|
||||
void right0() {
|
||||
Element max = getMax();
|
||||
for (int i = max.index + 1; i < lenght; i++) {
|
||||
arr[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Element getMin() {
|
||||
int min = arr[0];
|
||||
int index = 0;
|
||||
for (int i = 1; i < lenght; i++) {
|
||||
if (arr[i] < min) {
|
||||
min = arr[i];
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
|
||||
Element answer = { min, index };
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
Element getMax() {
|
||||
int max = arr[0];
|
||||
int index = 0;
|
||||
for (int i = 1; i < lenght; i++) {
|
||||
if (arr[i] > max) {
|
||||
max = arr[i];
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
|
||||
Element answer = { max, index };
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
//14
|
||||
void deleteElement(int index) {
|
||||
if (! (index >= 0 && index <= lenght)) {
|
||||
return;
|
||||
}
|
||||
|
||||
lenght -= 1;
|
||||
|
||||
for (int i = index; i < lenght; i++) {
|
||||
arr[i] = arr[i+1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void insertElement(int value, int index) {
|
||||
if (! (index >= 0 && index <= lenght)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = lenght; i >index; i--) {
|
||||
arr[i] = arr[i-1];
|
||||
}
|
||||
lenght += 1;
|
||||
arr[index] = value;
|
||||
}
|
||||
|
||||
void printArr() {
|
||||
printf("< ");
|
||||
for (int i = 0; i < lenght; i++) {
|
||||
printf("%d ", arr[i]);
|
||||
}
|
||||
printf(">\n");
|
||||
}
|
||||
|
||||
void menuText() {
|
||||
printf("\n\n");
|
||||
if (lenght != 0) {
|
||||
printf("äëèííà: %d\n", lenght);
|
||||
printArr();
|
||||
}
|
||||
printf("--------------\n");
|
||||
printf("âûáåðèòå íóæíóþ âàì îïåðàöèÿ:\n");
|
||||
printf("1) Ââåñòè ñ êëàâèàòóðó\n");
|
||||
printf("2) õ10 äëÿ âñåõ íå÷åòíûõ\n");
|
||||
printf("3) Íàéòè ìèíèìàëüíûé ýëåìåíò\n");
|
||||
printf("4) Êîëè÷åñòâî ýë > 10\n");
|
||||
printf("5) õ2 äëÿ ïîñëåäíåãî ÷åòíîãî\n");
|
||||
printf("6) ñêîëüêî ÷åòíûõ ëåâåå ìèíèìàëüíîãî\n");
|
||||
printf("7) õ10 äëÿ íå÷åòíûõ ïðàâåå ìèíèìàëüíîãî\n");
|
||||
printf("8) ïåìåíÿòü ìåñòàìè min è max\n");
|
||||
printf("9) x-1\n");
|
||||
printf("10) çàìåíèòü íà 4 el<4\n");
|
||||
printf("11) el>>max çàìåíèòü íà 0\n");
|
||||
printf("21) óäàëèòü ïî èíäåêñó\n");
|
||||
printf("22) âñòàâèòü ïî èíäåêñó\n");
|
||||
printf("23) óäàëèòü ìèíèìàëüíûé\n");
|
||||
printf("24) ïåðåä ìèíèìàëüíûì âñòàâèòü 0\n");
|
||||
printf("25) óäàëèòü ìàêñèìàëüíûé ÷åòíûé\n");
|
||||
printf("\n");
|
||||
printf("0) âûéòè\n");
|
||||
printf("âûáðàííàÿ îïåðàöèÿ >>> ");
|
||||
}
|
||||
|
||||
void startProg() {
|
||||
int ans;
|
||||
int ind, value;
|
||||
do {
|
||||
menuText();
|
||||
scanf_s("%d", &ans);
|
||||
|
||||
switch (ans)
|
||||
{
|
||||
case 1:
|
||||
setArray();
|
||||
break;
|
||||
case 2:
|
||||
oddX10();
|
||||
break;
|
||||
case 3:
|
||||
printf("min = %d", getMin().index);
|
||||
break;
|
||||
case 4:
|
||||
printf("k = %d", countGreaterThen(10));
|
||||
break;
|
||||
case 5:
|
||||
timesLastEven(2);
|
||||
break;
|
||||
case 6:
|
||||
printf("k = %d", countEvenLeftOfMin());
|
||||
break;
|
||||
case 7:
|
||||
timesOddRightOfMin(10);
|
||||
break;
|
||||
case 8:
|
||||
ReplaceMinMax();
|
||||
break;
|
||||
case 9:
|
||||
allEven(-1);
|
||||
break;
|
||||
case 10:
|
||||
allLess4();
|
||||
break;
|
||||
case 11:
|
||||
right0();
|
||||
break;
|
||||
case 21:
|
||||
printf("index: ");
|
||||
;
|
||||
scanf_s("%d", &ind);
|
||||
deleteElement(ind);
|
||||
break;
|
||||
case 22:
|
||||
printf("index: ");
|
||||
scanf_s("%d", &ind);
|
||||
|
||||
printf("value: ");
|
||||
scanf_s("%d", &value);
|
||||
insertElement(value,ind);
|
||||
break;
|
||||
case 23:
|
||||
deleteElement(getMin().index);
|
||||
break;
|
||||
case 24:
|
||||
insertElement(0, getMin().index);
|
||||
break;
|
||||
case 25:
|
||||
value = arr[0];
|
||||
ind = 0;
|
||||
for (int i = 1; i < lenght; i++) {
|
||||
if (arr[i] % 2 == 0 && arr[i] > value) {
|
||||
value = arr[i];
|
||||
ind = i;
|
||||
}
|
||||
|
||||
}
|
||||
deleteElement(ind);
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (ans != 0);
|
||||
}
|
14
13-14/Function.h
Normal file
@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define DEFAULT_LENGHT 10
|
||||
|
||||
extern int arr[DEFAULT_LENGHT];
|
||||
|
||||
typedef struct {
|
||||
int value, index;
|
||||
} Element;
|
||||
|
||||
void startProg();
|
12
13-14/Main.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
#include "Function.h"
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
startProg();
|
||||
|
||||
return 0;
|
||||
}
|
2
13-14/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
139
15/15.vcxproj
Normal file
@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{8cbc5826-531f-45fd-aa76-17dcd4e25d30}</ProjectGuid>
|
||||
<RootNamespace>My15</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.c" />
|
||||
<ClCompile Include="TwoDimentionalArray.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="TwoDimentionalArray.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
30
15/15.vcxproj.filters
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TwoDimentionalArray.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="TwoDimentionalArray.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
13
15/Main.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
startProg();
|
||||
|
||||
return 0;
|
||||
}
|
240
15/TwoDimentionalArray.c
Normal file
@ -0,0 +1,240 @@
|
||||
#include "TwoDimentionalArray.h"
|
||||
|
||||
int arr[MAX_LENGTH][MAX_LENGTH];
|
||||
int width, height;
|
||||
|
||||
void inputdem() {
|
||||
printf("height ");
|
||||
scanf_s("%d", &height);
|
||||
|
||||
printf("width ");
|
||||
scanf_s("%d", &width);
|
||||
}
|
||||
|
||||
void randomEl() {
|
||||
if (width == 0 || height == 0) inputdem();
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
arr[i][j] = rand() % 10 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void iX10j() {
|
||||
if (width == 0 || height == 0) inputdem();
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
arr[i][j] = (i+1)*10+j+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setZero() {
|
||||
if (width == 0 || height == 0) inputdem();
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
arr[i][j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void inputArr() {
|
||||
inputdem();
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
scanf_s("%d", &arr[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void oddX10() {
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
if (arr[i][j] % 2 != 0) {
|
||||
arr[i][j] = arr[i][j] * 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void del10() {
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
if (arr[i][j] % 10 == 0) {
|
||||
arr[i][j] = arr[i][j] / 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void save() {
|
||||
FILE* fout = fopen("D:\\university\\ÎÀÈÏ\\lab\\Temp\\test.txt", "wt");
|
||||
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå ñîçäàëñÿ");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fout, "%d ", height);
|
||||
fprintf(fout, "%d\n", width);
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
fprintf(fout, "%d ", arr[i][j]);
|
||||
}
|
||||
fprintf(fout, "\n");
|
||||
}
|
||||
|
||||
printf("ñîõðàíåíèå\n");
|
||||
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
void load() {
|
||||
FILE* fin = fopen("D:\\university\\ÎÀÈÏ\\lab\\Temp\\test.txt", "rt");
|
||||
|
||||
if (fin == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå íàéäåí");
|
||||
return;
|
||||
}
|
||||
|
||||
fscanf_s(fin, "%d", &height);
|
||||
fscanf_s(fin, "%d", &width);
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
fscanf_s(fin, "%d", &arr[i][j]);
|
||||
}
|
||||
}
|
||||
|
||||
printf("çàãðóçêà\n");
|
||||
|
||||
fclose(fin);
|
||||
}
|
||||
|
||||
void dublicateCol() {
|
||||
int index;
|
||||
printf("index ");
|
||||
scanf_s("%d", &index);
|
||||
for (int i = width; i > index; i--) {
|
||||
for (int j = 0; j < height; j++) {
|
||||
arr[j][i] = arr[j][i - 1];
|
||||
}
|
||||
}
|
||||
width += 1;
|
||||
}
|
||||
|
||||
void DeleteRow() {
|
||||
int index;
|
||||
printf("index ");
|
||||
scanf_s("%d", &index);
|
||||
height -= 1;
|
||||
for (int i = index; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
arr[i][j] = arr[i + 1][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void zeroWhereRepeat() {
|
||||
for (int j = 0; j < width; j++) {
|
||||
|
||||
bool DO = false;
|
||||
|
||||
for (int i = 0; i < height - 1; i++) {
|
||||
for (int ii = i + 1; ii < height; ii++) {
|
||||
if (arr[i][j] == arr[ii][j]) {
|
||||
DO = true;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
end:
|
||||
if (DO) {
|
||||
for (int i = 0; i < height; i++) {
|
||||
arr[i][j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void printArr() {
|
||||
for (int i = 0; i < height; i++) {
|
||||
for (int j = 0; j < width; j++) {
|
||||
printf("%3d ", arr[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void menuText() {
|
||||
printf("\n\n");
|
||||
if (height != 0) {
|
||||
printf("äëèííà: %d\n", height);
|
||||
printArr(arr, width, height);
|
||||
}
|
||||
printf("--------------\n");
|
||||
printf("âûáåðèòå íóæíóþ âàì îïåðàöèÿ:\n");
|
||||
printf("1) Çàïîëíèòü çíà÷åíèÿìè i * 10 + j\n");
|
||||
printf("2) Çàïîëíèòü 0\n");
|
||||
printf("3) Çàïîëíèòü ñëó÷àéíûìè\n");
|
||||
printf("4) Âñå íå÷åòíûå õ10\n");
|
||||
printf("5) Âñå % 10 õ1del10\n");
|
||||
printf("6) Ìàññèâ ñ êëàâèàòóðû\n");
|
||||
printf("71) Ñîõðàíèòü\n");
|
||||
printf("72) Çàãðóçèòü\n");
|
||||
printf("8) 0 ãäå ïîñòîðÿåòñÿ\n");
|
||||
printf("9) Äóáëèðîâàòü êîëîíêó\n");
|
||||
printf("10) Óäàëèòü ñòðîêó\n");
|
||||
printf("\n");
|
||||
printf("-1) âûéòè\n");
|
||||
printf("âûáðàííàÿ îïåðàöèÿ >>> ");
|
||||
}
|
||||
|
||||
void startProg() {
|
||||
|
||||
srand(time(NULL));
|
||||
|
||||
int ans;
|
||||
do {
|
||||
menuText();
|
||||
scanf_s("%d", &ans);
|
||||
|
||||
switch (ans)
|
||||
{
|
||||
case 1:
|
||||
iX10j();
|
||||
break;
|
||||
case 2:
|
||||
setZero();
|
||||
break;
|
||||
case 3:
|
||||
randomEl();
|
||||
break;
|
||||
case 4:
|
||||
oddX10();
|
||||
break;
|
||||
case 5:
|
||||
del10();
|
||||
break;
|
||||
case 6:
|
||||
inputArr();
|
||||
break;
|
||||
case 71:
|
||||
save();
|
||||
break;
|
||||
case 72:
|
||||
load();
|
||||
break;
|
||||
case 8:
|
||||
zeroWhereRepeat();
|
||||
break;
|
||||
case 9:
|
||||
dublicateCol();
|
||||
break;
|
||||
case 10:
|
||||
DeleteRow();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} while (ans != -1);
|
||||
}
|
10
15/TwoDimentionalArray.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
|
||||
#define MAX_LENGTH 10
|
||||
|
||||
void startProg();
|
2
15/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
514
16/16.cpp
Normal file
@ -0,0 +1,514 @@
|
||||
// 16.cpp : Определяет точку входа для приложения.
|
||||
//
|
||||
|
||||
#include "framework.h"
|
||||
#include "16.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
|
||||
enum Material {
|
||||
void_m,
|
||||
player_m,
|
||||
wall_m,
|
||||
gold_m
|
||||
};
|
||||
|
||||
#define WIDTH_MAP 30
|
||||
#define HEIGHT_MAP 20
|
||||
|
||||
#define WIDTH_1 20
|
||||
#define HEIGHT_1 20
|
||||
|
||||
int map[HEIGHT_MAP][WIDTH_MAP] = {
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 3, 3, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 3, 0, 0, 0},
|
||||
|
||||
{0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 2, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0},
|
||||
{0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
int step = 0, gold = 0;
|
||||
|
||||
POINT getPlayerCoord() {
|
||||
|
||||
for (int i = 0; i < WIDTH_MAP; i++) {
|
||||
for (int j = 0; j < WIDTH_MAP; j++) {
|
||||
if (map[i][j] == 1) return { j,i };
|
||||
}
|
||||
}
|
||||
return { -1,-1 };
|
||||
}
|
||||
|
||||
void right() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0 || map[c.y][c.x + 1] == wall_m) return;
|
||||
|
||||
if (map[c.y][c.x + 1] == gold_m) {
|
||||
gold += 1;
|
||||
}
|
||||
|
||||
map[c.y][c.x + 1] = 1;
|
||||
map[c.y][c.x] = void_m;
|
||||
step++;
|
||||
}
|
||||
|
||||
void left() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0 || map[c.y][c.x - 1] == wall_m) return;
|
||||
|
||||
if (map[c.y][c.x - 1] == gold_m) {
|
||||
gold += 1;
|
||||
}
|
||||
|
||||
map[c.y][c.x - 1] = 1;
|
||||
map[c.y][c.x] = void_m;
|
||||
step++;
|
||||
}
|
||||
|
||||
void down() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0 || map[c.y + 1][c.x] == wall_m) return;
|
||||
|
||||
if (map[c.y + 1][c.x] == gold_m) {
|
||||
gold += 1;
|
||||
}
|
||||
|
||||
map[c.y + 1][c.x] = 1;
|
||||
map[c.y][c.x] = void_m;
|
||||
step++;
|
||||
}
|
||||
|
||||
void up() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0 || map[c.y - 1][c.x] == wall_m) return;
|
||||
|
||||
if (map[c.y - 1][c.x] == gold_m) {
|
||||
gold += 1;
|
||||
}
|
||||
|
||||
map[c.y - 1][c.x] = 1;
|
||||
map[c.y][c.x] = void_m;
|
||||
step++;
|
||||
}
|
||||
|
||||
void createWall() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0 || c.x - 1 < 0) return;
|
||||
|
||||
map[c.y][c.x - 1] = wall_m;
|
||||
}
|
||||
|
||||
void dropGold() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0 || c.x + 1 > WIDTH_MAP || map[c.y][c.x + 1] == gold_m || map[c.y][c.x + 1] == wall_m) return;
|
||||
|
||||
if (gold > 0) {
|
||||
map[c.y][c.x + 1] = gold_m;
|
||||
gold--;
|
||||
}
|
||||
}
|
||||
|
||||
void Z() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0) return;
|
||||
|
||||
for (int i = c.x + 1; i < WIDTH_MAP; i++) {
|
||||
if (map[c.y][i] == wall_m) map[c.y][i] = void_m;
|
||||
}
|
||||
}
|
||||
|
||||
void U() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0) return;
|
||||
|
||||
|
||||
for (int i = -2; i < 3; i++) {
|
||||
if (i == 0 || c.x+i < 0 || c.x + i >= WIDTH_MAP || c.y + i < 0 || c.y - i >= HEIGHT_MAP) continue;
|
||||
map[c.y + i][c.x + i] = wall_m;
|
||||
}
|
||||
|
||||
for (int i = -2; i < 3; i++) {
|
||||
if (i == 0 || c.x + i < 0 || c.x + i >= WIDTH_MAP || c.y - i < 0 || c.y + i >= HEIGHT_MAP) continue;
|
||||
map[c.y - i][c.x + i] = wall_m;
|
||||
}
|
||||
}
|
||||
|
||||
void D() {
|
||||
POINT c = getPlayerCoord();
|
||||
if (c.x < 0) return;
|
||||
|
||||
|
||||
for (int i = -2; i < 3; i++) {
|
||||
if (gold <= 0) break;
|
||||
if (i == 0 || c.x + i < 0 || c.x + i >= WIDTH_MAP || c.y + i < 0 || c.y - i >= HEIGHT_MAP) continue;
|
||||
if (map[c.y + i][c.x + i] == wall_m) continue;
|
||||
map[c.y + i][c.x + i] = gold_m;
|
||||
gold--;
|
||||
}
|
||||
|
||||
for (int i = -2; i < 3; i++) {
|
||||
if (gold <= 0) break;
|
||||
if (i == 0 || c.x + i < 0 || c.x + i >= WIDTH_MAP || c.y - i < 0 || c.y + i >= HEIGHT_MAP) continue;
|
||||
if (map[c.y - i][c.x + i] == wall_m) continue;
|
||||
map[c.y - i][c.x + i] = gold_m;
|
||||
gold--;
|
||||
}
|
||||
}
|
||||
|
||||
void save() {
|
||||
FILE* fout;
|
||||
fopen_s(&fout, "D:\\university\\ОАИП\\lab\\Temp\\game.bin", "wb");
|
||||
if (fout == NULL) {
|
||||
printf("");
|
||||
return;
|
||||
}
|
||||
int width = WIDTH_MAP, height = HEIGHT_MAP;
|
||||
|
||||
fwrite(&width, sizeof(width), 1, fout);
|
||||
fwrite(&height, sizeof(height), 1, fout);
|
||||
fwrite(&map, sizeof(map), 1, fout);
|
||||
fwrite(&step, sizeof(step), 1, fout);
|
||||
fwrite(&gold, sizeof(gold), 1, fout);
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
void load() {
|
||||
FILE* fin;
|
||||
fopen_s(&fin, "D:\\university\\ОАИП\\lab\\Temp\\game.bin", "rb");
|
||||
if (fin == NULL) {
|
||||
printf("");
|
||||
return;
|
||||
}
|
||||
int width, height;
|
||||
|
||||
fread(&width, sizeof(width), 1, fin);
|
||||
fread(&height, sizeof(height), 1, fin);
|
||||
fread(&map, sizeof(map), 1, fin);
|
||||
fread(&step, sizeof(step), 1, fin);
|
||||
fread(&gold, sizeof(gold), 1, fin);
|
||||
fclose(fin);
|
||||
}
|
||||
|
||||
void restartGame() {
|
||||
FILE* fin;
|
||||
fopen_s(&fin, "D:\\university\\ОАИП\\lab\\Temp\\start.bin", "rb");
|
||||
if (fin == NULL) {
|
||||
printf("");
|
||||
return;
|
||||
}
|
||||
int width, height;
|
||||
|
||||
fread(&width, sizeof(width), 1, fin);
|
||||
fread(&height, sizeof(height), 1, fin);
|
||||
fread(&map, sizeof(map), 1, fin);
|
||||
fread(&step, sizeof(step), 1, fin);
|
||||
fread(&gold, sizeof(gold), 1, fin);
|
||||
fclose(fin);
|
||||
}
|
||||
|
||||
void drawMap(HDC hdc) {
|
||||
HBRUSH materials[4] = {
|
||||
(HBRUSH)CreateSolidBrush(RGB(127,127,127)),
|
||||
(HBRUSH)CreateSolidBrush(RGB(0,0,255)),
|
||||
(HBRUSH)CreateSolidBrush(RGB(0,0,0)),
|
||||
(HBRUSH)CreateSolidBrush(RGB(255,255,0))
|
||||
};
|
||||
|
||||
for (int i = 0; i < HEIGHT_MAP; i++) {
|
||||
for (int j = 0; j < WIDTH_MAP; j++) {
|
||||
RECT r = { j * WIDTH_1, i * HEIGHT_1, (j + 1) * WIDTH_1, (i + 1) * HEIGHT_1 };
|
||||
FillRect(hdc, &r, materials[map[i][j]]);
|
||||
}
|
||||
}
|
||||
|
||||
char text[80];
|
||||
sprintf_s(text, "steps = %d, gold = %d", step, gold);
|
||||
TextOutA(hdc, 10, HEIGHT_MAP * HEIGHT_1, (LPCSTR)text, strlen(text));
|
||||
|
||||
for (int i = 0; i < 4; i++) DeleteObject(materials[i]);
|
||||
}
|
||||
|
||||
void Midas(int i, int j) {
|
||||
if (map[i][j] == 2) {
|
||||
map[i][j] = 3;
|
||||
if (i > 0) Midas(i - 1, j);
|
||||
if (i < HEIGHT_MAP - 1) Midas(i + 1, j);
|
||||
if (j > 0) Midas(i, j - 1);
|
||||
if (i < WIDTH_MAP) Midas(i, j + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void M() {
|
||||
POINT c = getPlayerCoord();
|
||||
Midas(c.y, c.x + 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
// Глобальные переменные:
|
||||
HINSTANCE hInst; // текущий экземпляр
|
||||
WCHAR szTitle[MAX_LOADSTRING]; // Текст строки заголовка
|
||||
WCHAR szWindowClass[MAX_LOADSTRING]; // имя класса главного окна
|
||||
|
||||
// Отправить объявления функций, включенных в этот модуль кода:
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
// TODO: Разместите код здесь.
|
||||
|
||||
// Инициализация глобальных строк
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_MY16, szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Выполнить инициализацию приложения:
|
||||
if (!InitInstance (hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MY16));
|
||||
|
||||
MSG msg;
|
||||
|
||||
// Цикл основного сообщения:
|
||||
while (GetMessage(&msg, nullptr, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: MyRegisterClass()
|
||||
//
|
||||
// ЦЕЛЬ: Регистрирует класс окна.
|
||||
//
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASSEXW wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
|
||||
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wcex.lpfnWndProc = WndProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MY16));
|
||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_MY16);
|
||||
wcex.lpszClassName = szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
|
||||
return RegisterClassExW(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: InitInstance(HINSTANCE, int)
|
||||
//
|
||||
// ЦЕЛЬ: Сохраняет маркер экземпляра и создает главное окно
|
||||
//
|
||||
// КОММЕНТАРИИ:
|
||||
//
|
||||
// В этой функции маркер экземпляра сохраняется в глобальной переменной, а также
|
||||
// создается и выводится главное окно программы.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Сохранить маркер экземпляра в глобальной переменной
|
||||
|
||||
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
|
||||
|
||||
if (!hWnd)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
//
|
||||
// ЦЕЛЬ: Обрабатывает сообщения в главном окне.
|
||||
//
|
||||
// WM_COMMAND - обработать меню приложения
|
||||
// WM_PAINT - Отрисовка главного окна
|
||||
// WM_DESTROY - отправить сообщение о выходе и вернуться
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
{
|
||||
int wmId = LOWORD(wParam);
|
||||
// Разобрать выбор в меню:
|
||||
switch (wmId)
|
||||
{
|
||||
case IDM_ABOUT:
|
||||
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
|
||||
break;
|
||||
case ISave:
|
||||
save();
|
||||
break;
|
||||
case ILoad:
|
||||
load();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case IDM_EXIT:
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hWnd, &ps);
|
||||
// TODO: Добавьте сюда любой код прорисовки, использующий HDC...
|
||||
|
||||
drawMap(hdc);
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
break;
|
||||
case WM_CHAR:
|
||||
switch (wParam) {
|
||||
case 'l':
|
||||
createWall();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case 'r':
|
||||
dropGold();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case 'z':
|
||||
Z();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case 'u':
|
||||
U();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case 'd':
|
||||
D();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case 'm':
|
||||
M();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case WM_KEYDOWN:
|
||||
switch (wParam)
|
||||
{
|
||||
case VK_RIGHT:
|
||||
right();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case VK_LEFT:
|
||||
left();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case VK_UP:
|
||||
up();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case VK_DOWN:
|
||||
down();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case VK_F5:
|
||||
save();
|
||||
break;
|
||||
case VK_F9:
|
||||
load();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case VK_F6:
|
||||
restartGame();
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Обработчик сообщений для окна "О программе".
|
||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return (INT_PTR)TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
}
|
148
16/16.vcxproj
Normal file
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{ca6a78f7-f0cf-443e-a713-347385883516}</ProjectGuid>
|
||||
<RootNamespace>My16</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="16.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="16.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="16.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="16.ico" />
|
||||
<Image Include="small.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
49
16/16.vcxproj.filters
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="16.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="16.cpp">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="16.rc">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="small.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
<Image Include="16.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
2
16/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
15
16/framework.h
Normal file
@ -0,0 +1,15 @@
|
||||
// header.h: включаемый файл для стандартных системных включаемых файлов
|
||||
// или включаемые файлы для конкретного проекта
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#define WIN32_LEAN_AND_MEAN // Исключите редко используемые компоненты из заголовков Windows
|
||||
// Файлы заголовков Windows
|
||||
#include <windows.h>
|
||||
// Файлы заголовков среды выполнения C
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
31
16/resource.h
Normal file
@ -0,0 +1,31 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Включаемый файл, созданный в Microsoft Visual C++.
|
||||
// Используется 16.rc
|
||||
//
|
||||
#define IDC_MYICON 2
|
||||
#define IDD_MY16_DIALOG 102
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_MY16 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_MY16 109
|
||||
#define IDR_MAINFRAME 128
|
||||
#define ID_32771 32771
|
||||
#define ID_32772 32772
|
||||
#define ILoad 32773
|
||||
#define ISave 32774
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32775
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
BIN
16/small.ico
Normal file
After Width: | Height: | Size: 45 KiB |
6
16/targetver.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// // При включении SDKDDKVer.h будет задана самая новая из доступных платформ Windows.
|
||||
// Если вы планируете сборку приложения для предыдущей версии платформы Windows, включите WinSDKVer.h и
|
||||
// задайте желаемую платформу в макросе _WIN32_WINNT, прежде чем включать SDKDDKVer.h.
|
||||
#include <SDKDDKVer.h>
|
112
17/17.c
Normal file
@ -0,0 +1,112 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int fact(int);
|
||||
void f1(int), f2(int), f3(int);
|
||||
void recEGE1(int);
|
||||
void Z5(int);
|
||||
void Z6(int);
|
||||
void Z7G(int), Z7F(int);
|
||||
void Z9V8(int);
|
||||
|
||||
int main() {
|
||||
printf("%d", fact(5));
|
||||
|
||||
printf("\n");
|
||||
|
||||
f1(11);
|
||||
printf("\n");
|
||||
f2(11);
|
||||
printf("\n");
|
||||
f3(11);
|
||||
|
||||
printf("\n");
|
||||
|
||||
recEGE1(3);
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
Z5(10);
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
Z6(1);
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
Z7F(11);
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
Z9V8(5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fact(int a) {
|
||||
if (a < 0) return -1;
|
||||
if (a == 0) return 1;
|
||||
return fact(a - 1) * a;
|
||||
}
|
||||
|
||||
void f1(int a) {
|
||||
if (a < 0) return;
|
||||
printf("%d ", a);
|
||||
if (a >= 2) f1(a - 2);
|
||||
}
|
||||
|
||||
void f2(int a) {
|
||||
if (a < 0) return;
|
||||
if (a >= 2) f2(a - 2);
|
||||
printf("%d ", a);
|
||||
}
|
||||
|
||||
void f3(int a) {
|
||||
if (a < 0) return;
|
||||
if (a < 2) {
|
||||
printf("%d ", a);
|
||||
return;
|
||||
}
|
||||
printf("%d ", a);
|
||||
if (a >= 2) f3(a - 2);
|
||||
printf("%d ", a);
|
||||
}
|
||||
|
||||
void recEGE1(int n) {
|
||||
if (n >= 1) {
|
||||
printf("%d ", n);
|
||||
recEGE1(n - 1);
|
||||
recEGE1(n - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Z5(int n) {
|
||||
if (n >= 1) {
|
||||
printf("%d\n", n);
|
||||
Z5(n - 3);
|
||||
Z5(n - 4);
|
||||
}
|
||||
}
|
||||
|
||||
void Z6(int n) {
|
||||
if (n < 5) {
|
||||
printf("%d\n", n);
|
||||
Z5(n + 1);
|
||||
Z5(n + 3);
|
||||
}
|
||||
}
|
||||
|
||||
void Z7F(int a) {
|
||||
if (a > 0) Z7G(a - 1);
|
||||
};
|
||||
|
||||
void Z7G(int a) {
|
||||
printf("*");
|
||||
if (a > 1) Z7F(a - 3);
|
||||
};
|
||||
|
||||
void Z9V8(int a) {
|
||||
if (a < 0) return;
|
||||
printf("<*%d*", a);
|
||||
if (a > 1) Z9V8(a - 1);
|
||||
printf("%d>", a);
|
||||
}
|
135
17/17.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{85e1e279-bfca-48f2-ad89-22f8b3934ca4}</ProjectGuid>
|
||||
<RootNamespace>My17</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="17.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
17/17.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="17.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
2
17/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
448
18/18.cpp
Normal file
@ -0,0 +1,448 @@
|
||||
// 18.cpp : Определяет точку входа для приложения.
|
||||
//
|
||||
|
||||
#include "framework.h"
|
||||
#include "stdio.h"
|
||||
#include "18.h"
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
int count = 0;
|
||||
int Action = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void triangle(HDC hdc, int cx, int cy, int size) {
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
POINT pt[3] = {
|
||||
{cx,cy + size},
|
||||
{cx + size,cy - size},
|
||||
{cx - size,cy - size}
|
||||
};
|
||||
Polygon(hdc, pt, 3);
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void triangleFact1(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
triangle(hdc, cx, cy, size);
|
||||
triangleFact1(hdc, cx - size, cy - size, size / 2);
|
||||
triangleFact1(hdc, cx, cy + size, size / 2);
|
||||
}
|
||||
|
||||
void triangleFact2(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
triangle(hdc, cx, cy, size);
|
||||
triangleFact2(hdc, cx - size, cy - size, size / 2);
|
||||
triangleFact2(hdc, cx + size, cy - size, size / 2);
|
||||
}
|
||||
|
||||
void triangleFact3(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
triangle(hdc, cx, cy, size);
|
||||
triangleFact3(hdc, cx - size, cy - size, size / 2);
|
||||
triangleFact3(hdc, cx + size, cy - size, size / 2);
|
||||
triangleFact3(hdc, cx, cy + size, size / 2);
|
||||
}
|
||||
|
||||
void time(HDC hdc, int cx, int cy, int size) {
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
POINT pt[4] = {
|
||||
{cx + size,cy + size},
|
||||
{cx - size,cy + size},
|
||||
{cx + size / 2,cy - size},
|
||||
{cx - size / 2,cy - size},
|
||||
};
|
||||
Polygon(hdc, pt, 4);
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void timeFact1(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
time(hdc, cx, cy, size);
|
||||
timeFact1(hdc, cx - size / 2 , cy - size, size / 2);
|
||||
}
|
||||
|
||||
void timeFact2(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
time(hdc, cx, cy, size);
|
||||
timeFact2(hdc, cx - size / 2, cy - size, size / 2);
|
||||
timeFact2(hdc, cx + size / 2, cy - size, size / 2);
|
||||
}
|
||||
|
||||
void timeFact3(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
time(hdc, cx, cy, size);
|
||||
timeFact3(hdc, cx - size / 2, cy - size, size / 2);
|
||||
timeFact3(hdc, cx - size, cy + size, size / 2);
|
||||
timeFact3(hdc, cx + size / 2, cy - size, size / 2);
|
||||
timeFact3(hdc, cx + size, cy + size, size / 2);
|
||||
}
|
||||
|
||||
void dimond(HDC hdc, int cx, int cy, int size) {
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
POINT pt[4] = {
|
||||
{cx,cy - size},
|
||||
{cx + size,cy},
|
||||
{cx,cy + size},
|
||||
{cx - size,cy},
|
||||
};
|
||||
Polygon(hdc, pt, 4);
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void dimondFact1(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
dimond(hdc, cx, cy, size);
|
||||
dimondFact1(hdc, cx - size, cy, size / 2);
|
||||
dimondFact1(hdc, cx + size, cy, size / 2);
|
||||
}
|
||||
|
||||
void dimondFact2(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
dimond(hdc, cx, cy, size);
|
||||
dimondFact2(hdc, cx - size, cy, size / 2);
|
||||
dimondFact2(hdc, cx + size, cy, size / 2);
|
||||
dimondFact2(hdc, cx, cy + size, size / 2);
|
||||
}
|
||||
|
||||
void dimondFact3(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
dimond(hdc, cx, cy, size);
|
||||
dimondFact2(hdc, cx - size, cy, size / 2);
|
||||
dimondFact2(hdc, cx + size, cy, size / 2);
|
||||
dimondFact2(hdc, cx, cy - size, size / 2);
|
||||
}
|
||||
|
||||
void dimondFact4(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
dimond(hdc, cx, cy, size);
|
||||
dimondFact3(hdc, cx - size, cy, size / 2);
|
||||
dimondFact3(hdc, cx + size, cy, size / 2);
|
||||
dimondFact3(hdc, cx, cy + size, size / 2);
|
||||
dimondFact3(hdc, cx, cy - size, size / 2);
|
||||
}
|
||||
|
||||
void star(HDC hdc, int cx, int cy, int size) {
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
POINT pt[8] = {
|
||||
{cx,cy - size},
|
||||
{cx + size / 4,cy - size / 4},
|
||||
{cx + size,cy},
|
||||
{cx + size / 4,cy + size / 4},
|
||||
{cx,cy + size},
|
||||
{cx - size / 4,cy + size / 4},
|
||||
{cx - size,cy},
|
||||
{cx - size / 4,cy - size / 4},
|
||||
};
|
||||
Polygon(hdc, pt, 8);
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void starFact1(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
star(hdc, cx, cy, size);
|
||||
starFact1(hdc, cx - size, cy, size / 2);
|
||||
starFact1(hdc, cx + size, cy, size / 2);
|
||||
}
|
||||
|
||||
void starFact2(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
star(hdc, cx, cy, size);
|
||||
starFact2(hdc, cx, cy - size, size / 2);
|
||||
starFact2(hdc, cx, cy + size, size / 2);
|
||||
}
|
||||
|
||||
void starFact3(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
star(hdc, cx, cy, size);
|
||||
starFact3(hdc, cx, cy - size, size / 2);
|
||||
starFact3(hdc, cx, cy + size, size / 2);
|
||||
starFact3(hdc, cx - size, cy, size / 2);
|
||||
}
|
||||
|
||||
void arrow(HDC hdc, int cx, int cy, int size) {
|
||||
SelectObject(hdc, GetStockObject(NULL_BRUSH));
|
||||
POINT pt[7] = {
|
||||
{cx - size / 2,cy - size},
|
||||
{cx + size / 2,cy - size},
|
||||
{cx + size / 2,cy},
|
||||
{cx + size,cy},
|
||||
{cx,cy + size},
|
||||
{cx - size,cy},
|
||||
{cx - size / 2,cy},
|
||||
};
|
||||
Polygon(hdc, pt, 7);
|
||||
SelectObject(hdc, GetStockObject(DC_BRUSH));
|
||||
}
|
||||
|
||||
void arrowFactMini(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
arrow(hdc, cx, cy, size);
|
||||
|
||||
count++;
|
||||
char text[80];
|
||||
sprintf_s(text, "%d", count);
|
||||
TextOutA(hdc, cx, cy, (LPCSTR)text, strlen(text));
|
||||
|
||||
arrowFactMini(hdc, cx - size / 2, cy - size, size / 2);
|
||||
arrowFactMini(hdc, cx + size / 2, cy - size, size / 2);
|
||||
arrowFactMini(hdc, cx + size, cy, size / 2);
|
||||
arrowFactMini(hdc, cx, cy + size, size / 2);
|
||||
arrowFactMini(hdc, cx - size, cy, size / 2);
|
||||
}
|
||||
|
||||
void arrowFactMaxi(HDC hdc, int cx, int cy, int size) {
|
||||
if (size <= 10) return;
|
||||
arrow(hdc, cx, cy, size);
|
||||
|
||||
count++;
|
||||
char text[80];
|
||||
sprintf_s(text, "%d", count);
|
||||
TextOutA(hdc, cx, cy, (LPCSTR)text, strlen(text));
|
||||
|
||||
arrowFactMaxi(hdc, cx - size / 2, cy - size, size / 3);
|
||||
arrowFactMaxi(hdc, cx + size / 2, cy - size, size / 3);
|
||||
arrowFactMaxi(hdc, cx + size, cy, size / 3);
|
||||
arrowFactMaxi(hdc, cx, cy + size, size / 3);
|
||||
arrowFactMaxi(hdc, cx - size, cy, size / 3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Глобальные переменные:
|
||||
HINSTANCE hInst; // текущий экземпляр
|
||||
WCHAR szTitle[MAX_LOADSTRING]; // Текст строки заголовка
|
||||
WCHAR szWindowClass[MAX_LOADSTRING]; // имя класса главного окна
|
||||
|
||||
// Отправить объявления функций, включенных в этот модуль кода:
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
// TODO: Разместите код здесь.
|
||||
|
||||
// Инициализация глобальных строк
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_MY18, szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Выполнить инициализацию приложения:
|
||||
if (!InitInstance (hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MY18));
|
||||
|
||||
MSG msg;
|
||||
|
||||
// Цикл основного сообщения:
|
||||
while (GetMessage(&msg, nullptr, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: MyRegisterClass()
|
||||
//
|
||||
// ЦЕЛЬ: Регистрирует класс окна.
|
||||
//
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASSEXW wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
|
||||
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wcex.lpfnWndProc = WndProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MY18));
|
||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_MY18);
|
||||
wcex.lpszClassName = szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
|
||||
return RegisterClassExW(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: InitInstance(HINSTANCE, int)
|
||||
//
|
||||
// ЦЕЛЬ: Сохраняет маркер экземпляра и создает главное окно
|
||||
//
|
||||
// КОММЕНТАРИИ:
|
||||
//
|
||||
// В этой функции маркер экземпляра сохраняется в глобальной переменной, а также
|
||||
// создается и выводится главное окно программы.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Сохранить маркер экземпляра в глобальной переменной
|
||||
|
||||
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
|
||||
|
||||
if (!hWnd)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
//
|
||||
// ЦЕЛЬ: Обрабатывает сообщения в главном окне.
|
||||
//
|
||||
// WM_COMMAND - обработать меню приложения
|
||||
// WM_PAINT - Отрисовка главного окна
|
||||
// WM_DESTROY - отправить сообщение о выходе и вернуться
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
{
|
||||
int wmId = LOWORD(wParam);
|
||||
// Разобрать выбор в меню:
|
||||
switch (wmId)
|
||||
{
|
||||
case IDM_ABOUT:
|
||||
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
|
||||
break;
|
||||
case IDM_EXIT:
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hWnd, &ps);
|
||||
|
||||
count = 0;
|
||||
|
||||
switch (Action % 15) {
|
||||
case 0:
|
||||
triangleFact1(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 1:
|
||||
triangleFact2(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 2:
|
||||
triangleFact3(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 3:
|
||||
timeFact1(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 4:
|
||||
timeFact2(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 5:
|
||||
timeFact3(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 6:
|
||||
dimondFact1(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 7:
|
||||
dimondFact2(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 8:
|
||||
dimondFact3(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 9:
|
||||
dimondFact4(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 10:
|
||||
starFact1(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 11:
|
||||
starFact2(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 12:
|
||||
starFact3(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 13:
|
||||
arrowFactMini(hdc, 200, 200, 100);
|
||||
break;
|
||||
case 14:
|
||||
arrowFactMaxi(hdc, 200, 200, 100);
|
||||
break;
|
||||
}
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
break;
|
||||
case WM_KEYDOWN:
|
||||
Action ++;
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Обработчик сообщений для окна "О программе".
|
||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return (INT_PTR)TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
}
|
148
18/18.vcxproj
Normal file
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{4839da26-feba-494b-aa4a-af4a46c6ba51}</ProjectGuid>
|
||||
<RootNamespace>My18</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="18.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="18.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="18.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="18.ico" />
|
||||
<Image Include="small.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
49
18/18.vcxproj.filters
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="18.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="18.cpp">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="18.rc">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="small.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
<Image Include="18.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
30
18/Resource.h
Normal file
@ -0,0 +1,30 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Включаемый файл, созданный в Microsoft Visual C++.
|
||||
// Используется 18.rc
|
||||
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_MY18_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_MY18 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_MY18 109
|
||||
#define IDC_MYICON 2
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
// Следующие стандартные значения для новых объектов
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NO_MFC 130
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
2
18/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
15
18/framework.h
Normal file
@ -0,0 +1,15 @@
|
||||
// header.h: включаемый файл для стандартных системных включаемых файлов
|
||||
// или включаемые файлы для конкретного проекта
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#define WIN32_LEAN_AND_MEAN // Исключите редко используемые компоненты из заголовков Windows
|
||||
// Файлы заголовков Windows
|
||||
#include <windows.h>
|
||||
// Файлы заголовков среды выполнения C
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
BIN
18/small.ico
Normal file
After Width: | Height: | Size: 45 KiB |
6
18/targetver.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// // При включении SDKDDKVer.h будет задана самая новая из доступных платформ Windows.
|
||||
// Если вы планируете сборку приложения для предыдущей версии платформы Windows, включите WinSDKVer.h и
|
||||
// задайте желаемую платформу в макросе _WIN32_WINNT, прежде чем включать SDKDDKVer.h.
|
||||
#include <SDKDDKVer.h>
|
136
19-20/19-20.vcxproj
Normal file
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{969ad85f-9a3b-4a45-b60c-147307ec5453}</ProjectGuid>
|
||||
<RootNamespace>My1920</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="19.c" />
|
||||
<ClCompile Include="20.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
25
19-20/19-20.vcxproj.filters
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="19.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="20.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
204
19-20/19.c
Normal file
@ -0,0 +1,204 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
void srar(), Load();
|
||||
void Psrar(), PLoad(int);
|
||||
void Psrar3();
|
||||
void Z4();
|
||||
|
||||
int arr[1000];
|
||||
int* parr;
|
||||
int n;
|
||||
|
||||
int main1() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
Load();
|
||||
srar();
|
||||
|
||||
PLoad(0);
|
||||
Psrar();
|
||||
free(parr);
|
||||
|
||||
PLoad(1);
|
||||
Psrar3();
|
||||
free(parr);
|
||||
|
||||
PLoad(2);
|
||||
Z4();
|
||||
free(parr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Load() {
|
||||
FILE* fin = fopen("D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\in1.txt", "rt");
|
||||
if (fin == NULL) {
|
||||
printf("Âõîäíîé ôàéë íå íàéäåí\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fscanf_s(fin, "%d", &n);
|
||||
for (int i = 0; i < n; i++) {
|
||||
fscanf_s(fin, "%d", &arr[i]);
|
||||
}
|
||||
|
||||
fclose(fin);
|
||||
}
|
||||
|
||||
void srar() {
|
||||
float sa = 0;
|
||||
float s = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
s += arr[i];
|
||||
}
|
||||
sa = s / n;
|
||||
|
||||
|
||||
int m = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (arr[i] > sa) {
|
||||
m++;
|
||||
}
|
||||
}
|
||||
|
||||
FILE* fout = fopen("D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\out\\out1.txt", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå íàéäåí\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fout, "%d\n", m);
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (arr[i] > sa) {
|
||||
fprintf(fout, "%d ", arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
void PLoad(int action) {
|
||||
FILE* fin = NULL;
|
||||
if (action == 0) {
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\in2.txt", "rt");
|
||||
}
|
||||
else if (action == 1) {
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\in3.txt", "rt");
|
||||
}
|
||||
else if (action == 2) {
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\in4.txt", "rt");
|
||||
}
|
||||
|
||||
if (fin == NULL) {
|
||||
printf("Âõîäíîé ôàéë íå íàéäåí\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fscanf_s(fin, "%d", &n);
|
||||
parr = (int*)malloc(sizeof(int) * n);
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
fscanf_s(fin, "%d", &parr[i]);
|
||||
}
|
||||
|
||||
fclose(fin);
|
||||
}
|
||||
|
||||
void Psrar() {
|
||||
float sa = 0;
|
||||
float s = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
s += parr[i];
|
||||
}
|
||||
sa = s / n;
|
||||
|
||||
int m = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (parr[i] > sa) {
|
||||
m++;
|
||||
}
|
||||
}
|
||||
|
||||
FILE* fout = fopen("D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\out\\out2.txt", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå íàéäåí\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fout, "%d\n", m);
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (parr[i] > sa) {
|
||||
fprintf(fout, "%d ", parr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
void Psrar3() {
|
||||
float sa = 0;
|
||||
float s = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
s += parr[i];
|
||||
}
|
||||
sa = s / n;
|
||||
|
||||
int m = 0;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (parr[i] < sa && parr[i] > 0) {
|
||||
m++;
|
||||
}
|
||||
}
|
||||
|
||||
FILE* fout = fopen("D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\out\\out3.txt", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå íàéäåí\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fout, "%d\n", m);
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (parr[i] < sa && parr[i] > 0) {
|
||||
fprintf(fout, "%d ", parr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
void Z4() {
|
||||
float max = parr[0];
|
||||
for (int i = 1; i < n; i++) {
|
||||
if (parr[i] > max) {
|
||||
max = parr[i];
|
||||
}
|
||||
}
|
||||
|
||||
float more_then = max*2/3;
|
||||
|
||||
int k = 0;
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (parr[i] >= more_then) {
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FILE* fout = fopen("D:\\university\\ÎÀÈÏ\\lab\\Temp\\19-20\\out\\out4.txt", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå íàéäåí\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fout, "%d\n", k);
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (parr[i] >= more_then) {
|
||||
fprintf(fout, "%d ", parr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fout);
|
||||
}
|
169
19-20/20.c
Normal file
@ -0,0 +1,169 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
void printList(), clearList(), addToHead(int);
|
||||
int deleteFromHead(), contains(int);
|
||||
|
||||
void oddX10(), iX100(int), lessiX10(int);
|
||||
|
||||
|
||||
typedef struct NODE {
|
||||
int data;
|
||||
struct NODE* next;
|
||||
} Node;
|
||||
|
||||
Node* arr = NULL;
|
||||
|
||||
int main() {
|
||||
arr = NULL;
|
||||
printList();
|
||||
|
||||
addToHead(1);
|
||||
printList();
|
||||
|
||||
addToHead(2);
|
||||
printList();
|
||||
|
||||
addToHead(3);
|
||||
printList();
|
||||
|
||||
addToHead(4);
|
||||
addToHead(5);
|
||||
printList();
|
||||
|
||||
printf("DELETE\n");
|
||||
deleteFromHead();
|
||||
printList();
|
||||
|
||||
int ans = 0;
|
||||
|
||||
scanf_s("%d", &ans);
|
||||
printf("contains %d %d\n\n", ans, contains(ans));
|
||||
|
||||
printf("summ = %d\n\n", sum());
|
||||
|
||||
printf("k%%2==0 = %d\n\n", evenCount());
|
||||
|
||||
printf("ODD X 10\n");
|
||||
oddX10();
|
||||
printList();
|
||||
|
||||
scanf_s("%d", &ans);
|
||||
printf("a[%d] X 100\n", ans);
|
||||
iX100(ans);
|
||||
printList();
|
||||
|
||||
scanf_s("%d", &ans);
|
||||
printf("less a[%d] X 10\n", ans);
|
||||
lessiX10(ans);
|
||||
printList();
|
||||
|
||||
clearList();
|
||||
printList();
|
||||
}
|
||||
|
||||
void printList() {
|
||||
Node* ptr = arr;
|
||||
while (ptr != NULL) {
|
||||
printf("(%d) -> ", ptr->data);
|
||||
ptr = ptr->next;
|
||||
}
|
||||
printf("NULL\n\n");
|
||||
}
|
||||
|
||||
void addToHead(int value) {
|
||||
Node* newNode = (struct Node*)malloc(sizeof(Node));
|
||||
|
||||
newNode->next = arr;
|
||||
newNode->data = value;
|
||||
|
||||
arr = newNode;
|
||||
}
|
||||
|
||||
int deleteFromHead() {
|
||||
int value = arr->data;
|
||||
Node* delNode = arr;
|
||||
arr = arr->next;
|
||||
free(delNode);
|
||||
return value;
|
||||
}
|
||||
|
||||
int contains(int value) {
|
||||
Node* ptr = arr;
|
||||
while (ptr != NULL) {
|
||||
if (ptr->data == value) {
|
||||
return 1;
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void clearList() {
|
||||
while (arr != NULL)
|
||||
{
|
||||
Node* delNode = arr;
|
||||
arr = arr->next;
|
||||
free(delNode);
|
||||
}
|
||||
}
|
||||
|
||||
int sum() {
|
||||
Node* ptr = arr;
|
||||
int s = 0;
|
||||
while (ptr != NULL) {
|
||||
s += ptr->data;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
int evenCount() {
|
||||
Node* ptr = arr;
|
||||
int k = 0;
|
||||
while (ptr != NULL) {
|
||||
if (ptr->data % 2 == 0) {
|
||||
k++;
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
void oddX10() {
|
||||
Node* ptr = arr;
|
||||
while (ptr != NULL) {
|
||||
if (ptr->data % 2 != 0) {
|
||||
ptr->data *= 10;
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
}
|
||||
|
||||
void iX100(int i) {
|
||||
Node* ptr = arr;
|
||||
int index = 0;
|
||||
while (ptr != NULL) {
|
||||
if (index == i) {
|
||||
ptr->data *= 100;
|
||||
return;
|
||||
}
|
||||
index += 1;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
}
|
||||
|
||||
void lessiX10(int i) {
|
||||
Node* ptr = arr;
|
||||
int index = 0;
|
||||
while (ptr != NULL) {
|
||||
if (index < i) {
|
||||
ptr->data = ptr->data * 10;
|
||||
}
|
||||
if (index == i) {
|
||||
return;
|
||||
}
|
||||
index += 1;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
}
|
2
19-20/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
136
21-22/21-22.vcxproj
Normal file
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{5fa1270b-cd23-45e0-85b8-08b50975c2b9}</ProjectGuid>
|
||||
<RootNamespace>My2122</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="21.c" />
|
||||
<ClCompile Include="22.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
25
21-22/21-22.vcxproj.filters
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="21.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="22.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
110
21-22/21.c
Normal file
@ -0,0 +1,110 @@
|
||||
#include "stdio.h"
|
||||
#include "Windows.h"
|
||||
|
||||
int isDigit(char);
|
||||
char toUpperCase(char);
|
||||
|
||||
int main1() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
printf("Ââåäèòå ñèìâîë: ");
|
||||
|
||||
char ch = ' ';
|
||||
scanf_s("%c", &ch);
|
||||
|
||||
|
||||
|
||||
printf("Çàäà÷à 1\n");
|
||||
|
||||
for (int i = ch; i <= ch + 19; i++) {
|
||||
printf("%c, %d\n", i, i);
|
||||
}
|
||||
|
||||
printf("\nÇàäà÷à 2\n");
|
||||
|
||||
for (int i = ch; i >= ch - 29; i--) {
|
||||
printf("%c, %d\n", i, i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
printf("\nÇàäà÷à 3\n");
|
||||
|
||||
char str[100];
|
||||
int k = 0;
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
for (int i = 0; i < strlen(str); i++)
|
||||
if (str[i] == ' ') k++;
|
||||
|
||||
printf("êîëè÷åñòâî ïðîáåëîâ = %d\n", k);
|
||||
|
||||
|
||||
|
||||
printf("\nÇàäà÷à 4\n");
|
||||
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
for (int i = 0; i < strlen(str); i++)
|
||||
if (str[i] == ' ') str[i] = '#';
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
|
||||
|
||||
printf("\nÇàäà÷à 5\n");
|
||||
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
for (int i = 0; i < strlen(str); i++)
|
||||
if (isDigit(str[i])) str[i] = '$';
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
|
||||
|
||||
|
||||
printf("\nÇàäà÷à 6\n");
|
||||
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
for (int i = 0; i < strlen(str); i++)
|
||||
str[i] = toUpperCase(str[i]);
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
|
||||
|
||||
printf("\nÇàäà÷à 9 Â8\n");
|
||||
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
for (int i = 0; i < strlen(str); i++)
|
||||
if(!(str[i] >= 'a' && str[i] <= 'z' || str[i] >= 'A' && str[i] <= 'Z'))
|
||||
str[i] = '_';
|
||||
|
||||
printf("%s\n", str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isDigit(char c) {
|
||||
return c > '0' && c <= '9';
|
||||
}
|
||||
|
||||
char toUpperCase(char c) {
|
||||
if (c >= 'a' && c <= 'z') return 'A' + (c - 'a');
|
||||
if (c == '¸') return '¨';
|
||||
return c;
|
||||
}
|
99
21-22/22.c
Normal file
@ -0,0 +1,99 @@
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#include "Windows.h"
|
||||
|
||||
int mystrlen(char[]), mystrlenpoint(char*);
|
||||
int mystrcmp(char[], char[]), mystrcmppoint(char*, char*);
|
||||
void mystrcpy(char*, char*);
|
||||
void mystrcat(char*, char*);
|
||||
void mystrcpyn(char*, char*, int);
|
||||
|
||||
int main() {
|
||||
char str[100];
|
||||
char str1[100];
|
||||
int n;
|
||||
|
||||
printf("cpyn\n");
|
||||
scanf_s(" %[^\n]", &str1, 100);
|
||||
scanf_s("%d", &n);
|
||||
mystrcpyn(&str, &str1, n);
|
||||
printf("1 = %s, 2 = %s\n", str, str1);
|
||||
|
||||
printf("len\n");
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
printf("len = %d\n", mystrlen(str));
|
||||
|
||||
printf("len pointer\n");
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
printf("len pointer = %d\n", mystrlenpoint(&str));
|
||||
|
||||
printf("cmp\n");
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
scanf_s(" %[^\n]", &str1, 100);
|
||||
printf("str - str1 = %d\n", mystrcmp(str, str1));
|
||||
|
||||
|
||||
printf("cmp pointer\n");
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
scanf_s(" %[^\n]", &str1, 100);
|
||||
printf("str - str1 = %d\n", mystrcmppoint(&str, &str1));
|
||||
|
||||
printf("cpy\n");
|
||||
scanf_s(" %[^\n]", &str1, 100);
|
||||
mystrcpy(str, str1);
|
||||
printf("1 = %s, 2 = %s\n", str, str1);
|
||||
|
||||
printf("cat\n");
|
||||
scanf_s(" %[^\n]", &str, 100);
|
||||
scanf_s(" %[^\n]", &str1, 100);
|
||||
mystrcat(str, str1);
|
||||
printf("%s", str);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mystrlen(char c[]) {
|
||||
int k = 0;
|
||||
for (int i = 0; c[i] != '\0'; i++) k++;
|
||||
return k;
|
||||
}
|
||||
|
||||
int mystrlenpoint(char *c) {
|
||||
char* p = c;
|
||||
while (*p++);
|
||||
return p - c - 1;
|
||||
}
|
||||
|
||||
int mystrcmp(char f[], char s[]) {
|
||||
int i;
|
||||
for (i = 0; f[i] != '\0' && s[i] != "\0"; i++) {
|
||||
if (f[i] - s[i] != 0) break;
|
||||
}
|
||||
return f[i] - s[i];
|
||||
}
|
||||
|
||||
int mystrcmppoint(char *f, char *s) {
|
||||
int i;
|
||||
for (i = 0; f[i] != '\0' && s[i] != "\0"; i++) {
|
||||
if (f[i] - s[i] != 0) break;
|
||||
}
|
||||
return f[i] - s[i];
|
||||
}
|
||||
|
||||
void mystrcpy(char *f, char *s) {
|
||||
while (*f++ = *s++);
|
||||
}
|
||||
|
||||
void mystrcat(char* f, char* s) {
|
||||
while (*f) *f++;
|
||||
while (*f++ = *s++);
|
||||
}
|
||||
|
||||
void mystrcpyn(char* f, char* s, int n) {
|
||||
int i = 0;
|
||||
for (i = 0; s[i] != '\0' && i < n; i++) {
|
||||
f[i] = s[i];
|
||||
}
|
||||
f[i] = '\0';
|
||||
}
|
2
21-22/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
136
23-24/23-24.vcxproj
Normal file
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{a1aa69ee-c137-4f84-ac0f-b33c2b861640}</ProjectGuid>
|
||||
<RootNamespace>My2324</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="23.c" />
|
||||
<ClCompile Include="24.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
25
23-24/23-24.vcxproj.filters
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="23.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="24.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
116
23-24/23.c
Normal file
@ -0,0 +1,116 @@
|
||||
#include "stdio.h"
|
||||
#include "Windows.h"
|
||||
|
||||
#define MAX_LEN 80
|
||||
char s[MAX_LEN];
|
||||
|
||||
void Z1(), Z2(), Z4();
|
||||
|
||||
int main1() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
Z1();
|
||||
Z2();
|
||||
Z4();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Z1() {
|
||||
FILE* fin;
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\in1.txt", "rt");
|
||||
if (fin == NULL) {
|
||||
printf("Âõîäíîé ôàéë íå íàéäåí");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* fout;
|
||||
fopen_s(&fout, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\out1.txt", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå ñîçäàëñÿ");
|
||||
return;
|
||||
}
|
||||
|
||||
while (!feof(fin)) {
|
||||
if (fgets(s, MAX_LEN, fin) != NULL) {
|
||||
for (int i = 0; s[i] != '\0'; i++) {
|
||||
if (s[i] == '\t') {
|
||||
s[i] = '%';
|
||||
}
|
||||
}
|
||||
fprintf(fout, "%s", s);
|
||||
printf(">>%s<<\n", s);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fin);
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
char toUpperCase(char c) {
|
||||
if (c >= 'a' && c <= 'z') return 'A' + (c - 'a');
|
||||
//printf(" %d = %c ", c, c);
|
||||
if (c >= 'à' && c <= 'ÿ') return 'À' + (c - 'à');
|
||||
if (c == '¸') return '¨';
|
||||
return c;
|
||||
}
|
||||
|
||||
void Z2() {
|
||||
FILE* fin;
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\in2.txt", "rt");
|
||||
if (fin == NULL) {
|
||||
printf("Âõîäíîé ôàéë íå íàéäåí");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* fout;
|
||||
fopen_s(&fout, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\out2.txt", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå ñîçäàëñÿ");
|
||||
return;
|
||||
}
|
||||
|
||||
while (!feof(fin)) {
|
||||
if (fgets(s, MAX_LEN, fin) != NULL) {
|
||||
for (int i = 0; s[i] != '\0'; i++) {
|
||||
s[i] = toUpperCase(s[i]);
|
||||
}
|
||||
fprintf(fout, "%s", s);
|
||||
printf(">>%s<<\n", s);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fin);
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
void Z4() {
|
||||
FILE* fin;
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\in4.txt", "rt");
|
||||
if (fin == NULL) {
|
||||
printf("Âõîäíîé ôàéë íå íàéäåí");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* fout;
|
||||
fopen_s(&fout, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\out4.txt", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå ñîçäàëñÿ");
|
||||
return;
|
||||
}
|
||||
|
||||
while (!feof(fin)) {
|
||||
if (fgets(s, MAX_LEN, fin) != NULL) {
|
||||
for (int i = 0; s[i] != '\0'; i++) {
|
||||
if (!((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z')))
|
||||
s[i] = '_';
|
||||
}
|
||||
fprintf(fout, "%s", s);
|
||||
printf(">>%s<<\n", s);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fin);
|
||||
fclose(fout);
|
||||
}
|
110
23-24/24.c
Normal file
@ -0,0 +1,110 @@
|
||||
#include "stdio.h"
|
||||
#include "Windows.h"
|
||||
|
||||
#define MAX_LEN 80
|
||||
char s[MAX_LEN];
|
||||
|
||||
void Z1html(), Z2html();
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
Z1html();
|
||||
Z2html();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Z1html() {
|
||||
FILE* fin;
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\in1html.txt", "rt");
|
||||
if (fin == NULL) {
|
||||
printf("Âõîäíîé ôàéë íå íàéäåí");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* fout;
|
||||
fopen_s(&fout, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\out1html.html", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå ñîçäàëñÿ");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fout, "<!DOCTYPE html><html><head><meta http - equiv = \"Content-Type\" content = \"text/html; charset=utf-8\"/><title>HTML Document</title></head><body>");
|
||||
|
||||
while (!feof(fin)) {
|
||||
if (fgets(s, MAX_LEN, fin) != NULL) {
|
||||
fprintf(fout, "%s<br>", s);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fout, "</body></html>");
|
||||
|
||||
fclose(fin);
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
void Z2html() {
|
||||
FILE* fin;
|
||||
fopen_s(&fin, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\in2html.txt", "rt");
|
||||
if (fin == NULL) {
|
||||
printf("Âõîäíîé ôàéë íå íàéäåí");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE* fout;
|
||||
fopen_s(&fout, "D:\\university\\ÎÀÈÏ\\lab\\Temp\\23-24\\out2html.html", "wt");
|
||||
if (fout == NULL) {
|
||||
printf("Âûõîäíîé ôàéë íå ñîçäàëñÿ");
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fout, "<!DOCTYPE html><html><head><meta http - equiv = \"Content-Type\" content = \"text/html; charset=utf-8\"/><title>HTML Document</title></head><body>");
|
||||
|
||||
while (!feof(fin)) {
|
||||
if (fgets(s, MAX_LEN, fin) != NULL) {
|
||||
int bold = 0;
|
||||
for (int i = 0; s[i] != '\0'; i++) {
|
||||
if (s[i + 1] == '\0') break;
|
||||
for (int j = i+1; s[j] != '\0'; j++) {
|
||||
if (s[i] == s[j]) {
|
||||
bold = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bold) break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int italic = 1;
|
||||
for (int i = 0; s[i] != '\0'; i++) {
|
||||
if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'à' && s[i] <= 'ÿ'))
|
||||
{
|
||||
italic = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bold && italic) {
|
||||
fprintf(fout, "<i><b>%s</b></i><br>", s);
|
||||
continue;
|
||||
}
|
||||
if (bold) {
|
||||
fprintf(fout, "<b>%s</b><br>", s);
|
||||
continue;
|
||||
}
|
||||
if (italic) {
|
||||
fprintf(fout, "<i>%s</i><br>", s);
|
||||
continue;
|
||||
}
|
||||
fprintf(fout, "%s<br>", s);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fout, "</body></html>");
|
||||
|
||||
fclose(fin);
|
||||
fclose(fout);
|
||||
}
|
2
23-24/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
140
910/910.vcxproj
Normal file
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{123e7787-05e1-478d-9cb1-f08abc0ab429}</ProjectGuid>
|
||||
<RootNamespace>My910</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>9-10</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="func.c" />
|
||||
<ClCompile Include="lab.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="func.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
30
910/910.vcxproj.filters
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="func.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="func.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
2
910/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
181
910/func.c
Normal file
@ -0,0 +1,181 @@
|
||||
#include "func.h"
|
||||
|
||||
#ifdef Z1
|
||||
void ot1do10(), ot10do1(), ot1_5odd(), ot1do100_10(), ot1000do100_100(), ot1000do0();
|
||||
|
||||
void Menu() {
|
||||
int n;
|
||||
|
||||
do
|
||||
{
|
||||
printf("Âűáĺđčňĺ íóćíóţ âŕě îďĺđŕöčţ:\n");
|
||||
printf("1) Âűâĺńňč ÷čńëŕ îň 1 äî 10\n");
|
||||
printf("2) Âűâĺńňč ÷čńëŕ îň 10 äî 1\n");
|
||||
printf("3) Âűâĺńňč 5 ďĺđâűé íĺ÷ĺňíűő ÷čńĺë ń 1\n");
|
||||
printf("11) Âűâĺńňč 10 ÷čńĺë îň 10 äî 100\n");
|
||||
printf("12) Âűâĺńňč 10 ÷čńĺë îň 1000 äî 100\n");
|
||||
printf("20) Âűâĺńňč ÷čńĺëŕ îň 1000 äî 0 ń řŕăîě\n\n");
|
||||
printf("99) Âűéňč čç ďđîăđŕěěű\n");
|
||||
|
||||
scanf_s("%d", &n);
|
||||
|
||||
switch (n)
|
||||
{
|
||||
case 1:
|
||||
ot1do10();
|
||||
break;
|
||||
case 2:
|
||||
ot10do1();
|
||||
break;
|
||||
case 3:
|
||||
ot1_5odd();
|
||||
break;
|
||||
case 11:
|
||||
ot1do100_10();
|
||||
break;
|
||||
case 12:
|
||||
ot1000do100_100();
|
||||
break;
|
||||
case 20:
|
||||
ot1000do0();
|
||||
break;
|
||||
}
|
||||
|
||||
} while (n != 99);
|
||||
}
|
||||
|
||||
void twospace() {
|
||||
printf("\n\n");
|
||||
}
|
||||
|
||||
void ot1do10() {
|
||||
int i = 1;
|
||||
while (i <= 10) {
|
||||
printf("%d ", i++);
|
||||
}
|
||||
twospace();
|
||||
}
|
||||
|
||||
void ot10do1() {
|
||||
int i = 10;
|
||||
while (i >= 1) {
|
||||
printf("%d ", i--);
|
||||
}
|
||||
twospace();
|
||||
}
|
||||
|
||||
void ot1_5odd() {
|
||||
int i = 0;
|
||||
while (i <= 4) {
|
||||
printf("%d ", 2 * i + 1);
|
||||
i++;
|
||||
}
|
||||
twospace();
|
||||
}
|
||||
|
||||
void ot1do100_10() {
|
||||
int i = 1;
|
||||
while (i <= 10) {
|
||||
printf("%d ", i * 10);
|
||||
i++;
|
||||
}
|
||||
twospace();
|
||||
}
|
||||
|
||||
void ot1000do100_100() {
|
||||
int i = 10;
|
||||
while (i >= 1) {
|
||||
printf("%d ", i * 100);
|
||||
i--;
|
||||
}
|
||||
twospace();
|
||||
}
|
||||
|
||||
void ot1000do0() {
|
||||
int i = 1000;
|
||||
int shag;
|
||||
printf("ââĺäčňĺ řŕă:");
|
||||
scanf_s("%d", &shag);
|
||||
cycle:
|
||||
printf("%d ", i);
|
||||
i -= shag;
|
||||
if (i > 0) goto cycle;
|
||||
printf("%d", 0);
|
||||
twospace();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef Z2
|
||||
void pif(), MN(), triangle();
|
||||
|
||||
void Menu() {
|
||||
int n;
|
||||
|
||||
do
|
||||
{
|
||||
printf("Âűáĺđčňĺ íóćíóţ âŕě îďĺđŕöčţ:\n");
|
||||
printf("1) âűâĺńňč ňŕáëčöó ďčôŕăîđŕ\n");
|
||||
printf("2) Âűâĺńňč ňŕáëčöó ń M ńňđîę č N ńňîëáöîâ\n");
|
||||
printf("3) Âűâĺńňč ňđĺóăîëüíóţ ěŕňđčöó íĺďđŕâčëüíóţ\n\n");
|
||||
printf("99) Âűéňč čç ďđîăđŕěěű\n");
|
||||
|
||||
scanf_s("%d", &n);
|
||||
|
||||
switch (n)
|
||||
{
|
||||
case 1:
|
||||
pif();
|
||||
break;
|
||||
case 2:
|
||||
MN();
|
||||
break;
|
||||
case 3:
|
||||
triangle();
|
||||
break;
|
||||
}
|
||||
|
||||
} while (n != 99);
|
||||
}
|
||||
|
||||
void MN() {
|
||||
int M = 0, N = 0;
|
||||
printf("ââĺäčňĺ M č N\n");
|
||||
scanf_s("%d%d", &M, &N);
|
||||
int i = 1;
|
||||
while (i <= M) {
|
||||
int j = 1;
|
||||
while (j <= N) {
|
||||
printf("%d%d ", i, j);
|
||||
j++;
|
||||
}
|
||||
printf("\n\n");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void triangle() {
|
||||
int i = 0;
|
||||
do {
|
||||
int j = 0;
|
||||
while (j < i+1) {
|
||||
printf("%d ", 5-j);
|
||||
j++;
|
||||
}
|
||||
i++;
|
||||
printf("\n");
|
||||
} while (i < 5);
|
||||
}
|
||||
|
||||
void pif() {
|
||||
int i = 1;
|
||||
while (i <= 10) {
|
||||
int j = 1;
|
||||
while (j <= 10) {
|
||||
printf("%3d ", i * j);
|
||||
j++;
|
||||
}
|
||||
printf("\n\n");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
#endif
|
6
910/func.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include <stdio.h>
|
||||
|
||||
#define Z2
|
||||
|
||||
void Menu();
|
13
910/lab.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
#include "func.h"
|
||||
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
Menu();
|
||||
|
||||
return 0;
|
||||
}
|
2
Temp/19-20/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
2
Temp/19-20/in1.txt
Normal file
@ -0,0 +1,2 @@
|
||||
6
|
||||
3 2 4 2 2 5
|
2
Temp/19-20/in2.txt
Normal file
@ -0,0 +1,2 @@
|
||||
6
|
||||
3 2 4 2 2 5
|
2
Temp/19-20/in3.txt
Normal file
@ -0,0 +1,2 @@
|
||||
6
|
||||
-10 -5 -1 2 6 25
|
2
Temp/19-20/in4.txt
Normal file
@ -0,0 +1,2 @@
|
||||
8
|
||||
10000 20000 35000 20000 50000 60000 18000 45000
|
2
Temp/23-24/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
1
Temp/23-24/in1.txt
Normal file
@ -0,0 +1 @@
|
||||
asdasd assdasdasd asd
|
17
Temp/23-24/in1html.txt
Normal file
@ -0,0 +1,17 @@
|
||||
asdasd assdasdasd asd
|
||||
asd
|
||||
asdasd
|
||||
asdasd
|
||||
|
||||
|
||||
asd
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
asdasd
|
||||
|
||||
|
||||
|
||||
asd
|
1
Temp/23-24/in2.txt
Normal file
@ -0,0 +1 @@
|
||||
asdфывASD123fh
|
5
Temp/23-24/in2html.txt
Normal file
@ -0,0 +1,5 @@
|
||||
aasd
|
||||
ASD
|
||||
AASD
|
||||
aaaaaa
|
||||
asdgasfgafsg
|
1
Temp/23-24/in4.txt
Normal file
@ -0,0 +1 @@
|
||||
asd asd фывфвыа фыап 12312 2451 231235
|
1
Temp/23-24/out1.txt
Normal file
@ -0,0 +1 @@
|
||||
asdasd%assdasdasd%%%asd
|
17
Temp/23-24/out1html.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html><html><head><meta http - equiv = "Content-Type" content = "text/html; charset=utf-8"/><title>HTML Document</title></head><body>asdasd assdasdasd asd
|
||||
<br>asd
|
||||
<br>asdasd
|
||||
<br>asdasd
|
||||
<br>
|
||||
<br>
|
||||
<br>asd
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>asdasd
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>asd<br></body></html>
|
1
Temp/23-24/out2.txt
Normal file
@ -0,0 +1 @@
|
||||
ASDфывASD123FH
|
5
Temp/23-24/out2html.html
Normal file
@ -0,0 +1,5 @@
|
||||
<!DOCTYPE html><html><head><meta http - equiv = "Content-Type" content = "text/html; charset=utf-8"/><title>HTML Document</title></head><body><b>aasd
|
||||
</b><br><i>ASD
|
||||
</i><br><i><b>AASD
|
||||
</b></i><br><b>aaaaaa
|
||||
</b><br><b>asdgasfgafsg</b><br></body></html>
|
1
Temp/23-24/out4.txt
Normal file
@ -0,0 +1 @@
|
||||
asd_asd____________________________________________
|
2
Temp/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
BIN
Temp/game.bin
Normal file
BIN
Temp/start.bin
Normal file
4
Temp/test.txt
Normal file
@ -0,0 +1,4 @@
|
||||
3 3
|
||||
1 2 3
|
||||
4 5 6
|
||||
7 8 9
|
BIN
additional_materials/L13-14/Z1.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
additional_materials/L13-14/Z2.png
Normal file
After Width: | Height: | Size: 13 KiB |
2
additional_materials/L13-14/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
BIN
additional_materials/L18/Z5.png
Normal file
After Width: | Height: | Size: 30 KiB |
2
additional_materials/L18/desktop.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=C:\Program Files\Google\Drive File Stream\100.0.2.0\GoogleDriveFS.exe,26
|
BIN
additional_materials/L3/L3Z2.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
additional_materials/L3/L3Z3.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
additional_materials/L3/L3Z5.png
Normal file
After Width: | Height: | Size: 34 KiB |