first commit
Этот коммит содержится в:
8
.gitignore
поставляемый
Обычный файл
8
.gitignore
поставляемый
Обычный файл
@@ -0,0 +1,8 @@
|
|||||||
|
*.tmp
|
||||||
|
*.log
|
||||||
|
*.ipch
|
||||||
|
*.cfg
|
||||||
|
*.db
|
||||||
|
*.vsidx
|
||||||
|
*.ilik
|
||||||
|
*.pdb
|
||||||
Двоичные данные
1/.vs/1/v17/.wsuo
Обычный файл
Двоичные данные
1/.vs/1/v17/.wsuo
Обычный файл
Двоичный файл не отображается.
3
1/.vs/ProjectSettings.json
Обычный файл
3
1/.vs/ProjectSettings.json
Обычный файл
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"CurrentProjectSetting": "Нет конфигураций"
|
||||||
|
}
|
||||||
9
1/.vs/VSWorkspaceState.json
Обычный файл
9
1/.vs/VSWorkspaceState.json
Обычный файл
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ExpandedNodes": [
|
||||||
|
"",
|
||||||
|
"\\1",
|
||||||
|
"\\1\\1"
|
||||||
|
],
|
||||||
|
"SelectedNode": "\\1\\1\\1.cpp",
|
||||||
|
"PreviewInSolutionExplorer": false
|
||||||
|
}
|
||||||
Двоичные данные
1/.vs/slnx.sqlite
Обычный файл
Двоичные данные
1/.vs/slnx.sqlite
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/.vs/1/v17/.suo
Обычный файл
Двоичные данные
1/1/.vs/1/v17/.suo
Обычный файл
Двоичный файл не отображается.
31
1/1/1.sln
Обычный файл
31
1/1/1.sln
Обычный файл
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.8.34316.72
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "1", "1\1.vcxproj", "{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Release|x64.Build.0 = Release|x64
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{41EE0FFE-2F91-4A19-9564-A19A8BE7CFA6}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {6166612C-F3AD-47D5-B946-DC204005CDCE}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
45
1/1/1/1.cpp
Обычный файл
45
1/1/1/1.cpp
Обычный файл
@@ -0,0 +1,45 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <bitset>
|
||||||
|
|
||||||
|
// Функция печати одного байта в шестнадцатеричном формате
|
||||||
|
void print_in_hex(uint8_t byte) {
|
||||||
|
std::cout << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(byte);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция печати блока данных в шестнадцатеричном формате
|
||||||
|
void print_in_hex(const void* data, size_t size) {
|
||||||
|
const uint8_t* byte_data = reinterpret_cast<const uint8_t*>(data);
|
||||||
|
for (size_t i = 0; i < size; ++i) {
|
||||||
|
print_in_hex(byte_data[i]);
|
||||||
|
std::cout << " ";
|
||||||
|
if ((i + 1) % 16 == 0) std::cout << "\n";
|
||||||
|
}
|
||||||
|
std::cout << std::dec << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция печати одного байта в двоичном формате
|
||||||
|
void print_in_binary(uint8_t byte) {
|
||||||
|
std::cout << std::bitset<8>(byte);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция печати блока данных в двоичном формате
|
||||||
|
void print_in_binary(const void* data, size_t size) {
|
||||||
|
const uint8_t* byte_data = reinterpret_cast<const uint8_t*>(data);
|
||||||
|
for (size_t i = 0; i < size; ++i) {
|
||||||
|
print_in_binary(byte_data[i]);
|
||||||
|
std::cout << " ";
|
||||||
|
if ((i + 1) % 4 == 0) std::cout << "\n";
|
||||||
|
}
|
||||||
|
std::cout << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
// Пример
|
||||||
|
uint8_t example_data[] = { 0xAD, 0xAC, 0xEF, 0x22, 0x84, 0x68, 0x75, 0x95 };
|
||||||
|
std::cout << "Hex Representation:\n";
|
||||||
|
print_in_hex(example_data, sizeof(example_data));
|
||||||
|
std::cout << "Binary Representation:\n";
|
||||||
|
print_in_binary(example_data, sizeof(example_data));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
135
1/1/1/1.vcxproj
Обычный файл
135
1/1/1/1.vcxproj
Обычный файл
@@ -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>{41ee0ffe-2f91-4a19-9564-a19a8be7cfa6}</ProjectGuid>
|
||||||
|
<RootNamespace>My1</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="1.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
22
1/1/1/1.vcxproj.filters
Обычный файл
22
1/1/1/1.vcxproj.filters
Обычный файл
@@ -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="1.cpp">
|
||||||
|
<Filter>Исходные файлы</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
4
1/1/1/1.vcxproj.user
Обычный файл
4
1/1/1/1.vcxproj.user
Обычный файл
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
||||||
11
1/1/1/x64/Debug/1.exe.recipe
Обычный файл
11
1/1/1/x64/Debug/1.exe.recipe
Обычный файл
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project>
|
||||||
|
<ProjectOutputs>
|
||||||
|
<ProjectOutput>
|
||||||
|
<FullPath>C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\1\1\x64\Debug\1.exe</FullPath>
|
||||||
|
</ProjectOutput>
|
||||||
|
</ProjectOutputs>
|
||||||
|
<ContentFiles />
|
||||||
|
<SatelliteDlls />
|
||||||
|
<NonRecipeFileRefs />
|
||||||
|
</Project>
|
||||||
Двоичные данные
1/1/1/x64/Debug/1.ilk
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.ilk
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/1/x64/Debug/1.obj
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.obj
Обычный файл
Двоичный файл не отображается.
2
1/1/1/x64/Debug/1.tlog/1.lastbuildstate
Обычный файл
2
1/1/1/x64/Debug/1.tlog/1.lastbuildstate
Обычный файл
@@ -0,0 +1,2 @@
|
|||||||
|
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.38.33130:TargetPlatformVersion=10.0.22621.0:
|
||||||
|
Debug|x64|C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\1\1\|
|
||||||
Двоичные данные
1/1/1/x64/Debug/1.tlog/CL.command.1.tlog
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.tlog/CL.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/1/x64/Debug/1.tlog/CL.read.1.tlog
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.tlog/CL.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/1/x64/Debug/1.tlog/CL.write.1.tlog
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.tlog/CL.write.1.tlog
Обычный файл
Двоичный файл не отображается.
1
1/1/1/x64/Debug/1.tlog/Cl.items.tlog
Обычный файл
1
1/1/1/x64/Debug/1.tlog/Cl.items.tlog
Обычный файл
@@ -0,0 +1 @@
|
|||||||
|
C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\1\1\1\1.cpp;C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\1\1\1\x64\Debug\1.obj
|
||||||
Двоичные данные
1/1/1/x64/Debug/1.tlog/link.command.1.tlog
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.tlog/link.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/1/x64/Debug/1.tlog/link.read.1.tlog
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.tlog/link.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/1/x64/Debug/1.tlog/link.write.1.tlog
Обычный файл
Двоичные данные
1/1/1/x64/Debug/1.tlog/link.write.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/1/x64/Debug/vc143.idb
Обычный файл
Двоичные данные
1/1/1/x64/Debug/vc143.idb
Обычный файл
Двоичный файл не отображается.
Двоичные данные
1/1/x64/Debug/1.exe
Обычный файл
Двоичные данные
1/1/x64/Debug/1.exe
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/.vs/2/v17/.suo
Обычный файл
Двоичные данные
2/2/.vs/2/v17/.suo
Обычный файл
Двоичный файл не отображается.
31
2/2/2.sln
Обычный файл
31
2/2/2.sln
Обычный файл
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.8.34316.72
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2", "2\2.vcxproj", "{B628E85E-63B4-48D1-BC31-F034B3D6F827}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Release|x64.Build.0 = Release|x64
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{B628E85E-63B4-48D1-BC31-F034B3D6F827}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {7D5FBC2B-BD9D-4C14-9B97-9BBCB56E086F}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
64
2/2/2/2.cpp
Обычный файл
64
2/2/2/2.cpp
Обычный файл
@@ -0,0 +1,64 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <bitset>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
// Функции для печати в шестнадцатеричном и двоичном формате с разделением байт
|
||||||
|
void print_in_hex(uint16_t value) {
|
||||||
|
std::cout << std::hex << std::setw(2) << std::setfill('0') << (value >> 8);
|
||||||
|
std::cout << ' ';
|
||||||
|
std::cout << std::hex << std::setw(2) << std::setfill('0') << (value & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_in_binary(uint16_t value) {
|
||||||
|
std::cout << std::bitset<8>(value >> 8) << ' ';
|
||||||
|
std::cout << std::bitset<8>(value & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция для выполнения побитовой операции
|
||||||
|
uint16_t calculate(uint16_t oper1, char operation, uint16_t oper2) {
|
||||||
|
switch (operation) {
|
||||||
|
case '&': return oper1 & oper2;
|
||||||
|
case '|': return oper1 | oper2;
|
||||||
|
case '^': return oper1 ^ oper2;
|
||||||
|
default: throw std::invalid_argument("Invalid operation");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
uint16_t oper1, oper2;
|
||||||
|
char operat;
|
||||||
|
|
||||||
|
// Ввод данных
|
||||||
|
std::cout << "Enter the first oper (uint16_t): ";
|
||||||
|
std::cin >> oper1;
|
||||||
|
|
||||||
|
std::cout << "Enter the operation (&, |, ^): ";
|
||||||
|
std::cin >> operat;
|
||||||
|
|
||||||
|
std::cout << "Enter the second oper (uint16_t): ";
|
||||||
|
std::cin >> oper2;
|
||||||
|
|
||||||
|
// Вычисление результата
|
||||||
|
uint16_t res = calculate(oper1, operat, oper2);
|
||||||
|
|
||||||
|
// Вывод результата в шестнадцатеричном формате
|
||||||
|
std::cout << "Result in hexadecimal: ";
|
||||||
|
print_in_hex(oper1);
|
||||||
|
std::cout << " & ";
|
||||||
|
print_in_hex(oper2);
|
||||||
|
std::cout << " = ";
|
||||||
|
print_in_hex(res);
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
// Вывод результата в двоичном формате
|
||||||
|
std::cout << "Result in binary: " << std::endl;
|
||||||
|
print_in_binary(oper1);
|
||||||
|
std::cout << " &" << std::endl;
|
||||||
|
print_in_binary(oper2);
|
||||||
|
std::cout << " =" << std::endl;
|
||||||
|
print_in_binary(res);
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
135
2/2/2/2.vcxproj
Обычный файл
135
2/2/2/2.vcxproj
Обычный файл
@@ -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>{b628e85e-63b4-48d1-bc31-f034b3d6f827}</ProjectGuid>
|
||||||
|
<RootNamespace>My2</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="2.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
22
2/2/2/2.vcxproj.filters
Обычный файл
22
2/2/2/2.vcxproj.filters
Обычный файл
@@ -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="2.cpp">
|
||||||
|
<Filter>Исходные файлы</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
4
2/2/2/2.vcxproj.user
Обычный файл
4
2/2/2/2.vcxproj.user
Обычный файл
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
||||||
11
2/2/2/x64/Debug/2.exe.recipe
Обычный файл
11
2/2/2/x64/Debug/2.exe.recipe
Обычный файл
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project>
|
||||||
|
<ProjectOutputs>
|
||||||
|
<ProjectOutput>
|
||||||
|
<FullPath>C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\2\2\x64\Debug\2.exe</FullPath>
|
||||||
|
</ProjectOutput>
|
||||||
|
</ProjectOutputs>
|
||||||
|
<ContentFiles />
|
||||||
|
<SatelliteDlls />
|
||||||
|
<NonRecipeFileRefs />
|
||||||
|
</Project>
|
||||||
Двоичные данные
2/2/2/x64/Debug/2.ilk
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.ilk
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/2/x64/Debug/2.obj
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.obj
Обычный файл
Двоичный файл не отображается.
2
2/2/2/x64/Debug/2.tlog/2.lastbuildstate
Обычный файл
2
2/2/2/x64/Debug/2.tlog/2.lastbuildstate
Обычный файл
@@ -0,0 +1,2 @@
|
|||||||
|
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.38.33130:TargetPlatformVersion=10.0.22621.0:
|
||||||
|
Debug|x64|C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\2\2\|
|
||||||
Двоичные данные
2/2/2/x64/Debug/2.tlog/CL.command.1.tlog
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.tlog/CL.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/2/x64/Debug/2.tlog/CL.read.1.tlog
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.tlog/CL.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/2/x64/Debug/2.tlog/CL.write.1.tlog
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.tlog/CL.write.1.tlog
Обычный файл
Двоичный файл не отображается.
1
2/2/2/x64/Debug/2.tlog/Cl.items.tlog
Обычный файл
1
2/2/2/x64/Debug/2.tlog/Cl.items.tlog
Обычный файл
@@ -0,0 +1 @@
|
|||||||
|
C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\2\2\2\2.cpp;C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\2\2\2\x64\Debug\2.obj
|
||||||
Двоичные данные
2/2/2/x64/Debug/2.tlog/link.command.1.tlog
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.tlog/link.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/2/x64/Debug/2.tlog/link.read.1.tlog
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.tlog/link.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/2/x64/Debug/2.tlog/link.write.1.tlog
Обычный файл
Двоичные данные
2/2/2/x64/Debug/2.tlog/link.write.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/2/x64/Debug/vc143.idb
Обычный файл
Двоичные данные
2/2/2/x64/Debug/vc143.idb
Обычный файл
Двоичный файл не отображается.
Двоичные данные
2/2/x64/Debug/2.exe
Обычный файл
Двоичные данные
2/2/x64/Debug/2.exe
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/.vs/3/v17/.suo
Обычный файл
Двоичные данные
3/3/.vs/3/v17/.suo
Обычный файл
Двоичный файл не отображается.
31
3/3/3.sln
Обычный файл
31
3/3/3.sln
Обычный файл
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.8.34316.72
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3", "3\3.vcxproj", "{AF4F3F97-A876-4AD6-B526-B1D0175B4800}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Release|x64.Build.0 = Release|x64
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{AF4F3F97-A876-4AD6-B526-B1D0175B4800}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {89D4CBD1-019F-4B79-A2F3-1F1C0FF0558D}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
57
3/3/3/3.cpp
Обычный файл
57
3/3/3/3.cpp
Обычный файл
@@ -0,0 +1,57 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <bitset>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
struct Student {
|
||||||
|
char name[17];
|
||||||
|
uint16_t year_of_admission;
|
||||||
|
float average_score;
|
||||||
|
unsigned int gender : 1;
|
||||||
|
unsigned int completed_courses;
|
||||||
|
Student* group_leader;
|
||||||
|
};
|
||||||
|
|
||||||
|
void print_in_hex(const void* data, size_t size) {
|
||||||
|
const unsigned char* byte_data = reinterpret_cast<const unsigned char*>(data);
|
||||||
|
for (size_t i = 0; i < size; ++i) {
|
||||||
|
std::cout << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(byte_data[i]) << " ";
|
||||||
|
}
|
||||||
|
std::cout << std::dec << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_student(const Student& student) {
|
||||||
|
std::cout << "Name: " << student.name << "\n";
|
||||||
|
std::cout << "Year of Admission: " << student.year_of_admission << "\n";
|
||||||
|
std::cout << "Average Score: " << student.average_score << "\n";
|
||||||
|
std::cout << "Gender: " << student.gender << "\n";
|
||||||
|
std::cout << "Completed Courses: " << student.completed_courses << "\n";
|
||||||
|
std::cout << "Group Leader: " << student.group_leader << "\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
Student group_leader = { "Smirnov Ivan", 2023, 4.8, 1, 13, nullptr };
|
||||||
|
Student student1 = { "Tihonov Pavel", 2024, 4.5, 1, 3, &group_leader };
|
||||||
|
Student student2 = { "Kyznecova Maria", 2022, 4.2, 0, 22, &group_leader };
|
||||||
|
Student students[] = { group_leader, student1, student2 };
|
||||||
|
|
||||||
|
std::cout << "Address of array: " << &students << "\n";
|
||||||
|
std::cout << "Size of array: " << sizeof(students) << " bytes\n\n";
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; ++i) {
|
||||||
|
std::cout << "Address of students[" << i << "]: " << &students[i] << "\n";
|
||||||
|
std::cout << "Size of students[" << i << "]: " << sizeof(students[i]) << " bytes\n";
|
||||||
|
}
|
||||||
|
std::cout << "\n";
|
||||||
|
|
||||||
|
// Информация для не старосты (student1)
|
||||||
|
std::cout << "Address of student1.name: " << static_cast<void*>(student1.name) << "\n";
|
||||||
|
std::cout << "Offset of name: " << offsetof(Student, name) << "\n";
|
||||||
|
std::cout << "Size of name: " << sizeof(student1.name) << "\n";
|
||||||
|
print_in_hex(student1.name, sizeof(student1.name));
|
||||||
|
|
||||||
|
std::cout << "\nHex representation of all array elements:\n";
|
||||||
|
print_in_hex(students, sizeof(students));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
135
3/3/3/3.vcxproj
Обычный файл
135
3/3/3/3.vcxproj
Обычный файл
@@ -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>{af4f3f97-a876-4ad6-b526-b1d0175b4800}</ProjectGuid>
|
||||||
|
<RootNamespace>My3</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="3.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
22
3/3/3/3.vcxproj.filters
Обычный файл
22
3/3/3/3.vcxproj.filters
Обычный файл
@@ -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="3.cpp">
|
||||||
|
<Filter>Исходные файлы</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
4
3/3/3/3.vcxproj.user
Обычный файл
4
3/3/3/3.vcxproj.user
Обычный файл
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
||||||
11
3/3/3/x64/Debug/3.exe.recipe
Обычный файл
11
3/3/3/x64/Debug/3.exe.recipe
Обычный файл
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project>
|
||||||
|
<ProjectOutputs>
|
||||||
|
<ProjectOutput>
|
||||||
|
<FullPath>C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\3\3\x64\Debug\3.exe</FullPath>
|
||||||
|
</ProjectOutput>
|
||||||
|
</ProjectOutputs>
|
||||||
|
<ContentFiles />
|
||||||
|
<SatelliteDlls />
|
||||||
|
<NonRecipeFileRefs />
|
||||||
|
</Project>
|
||||||
Двоичные данные
3/3/3/x64/Debug/3.ilk
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.ilk
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/3/x64/Debug/3.obj
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.obj
Обычный файл
Двоичный файл не отображается.
2
3/3/3/x64/Debug/3.tlog/3.lastbuildstate
Обычный файл
2
3/3/3/x64/Debug/3.tlog/3.lastbuildstate
Обычный файл
@@ -0,0 +1,2 @@
|
|||||||
|
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.38.33130:TargetPlatformVersion=10.0.22621.0:
|
||||||
|
Debug|x64|C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\3\3\|
|
||||||
Двоичные данные
3/3/3/x64/Debug/3.tlog/CL.command.1.tlog
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.tlog/CL.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/3/x64/Debug/3.tlog/CL.read.1.tlog
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.tlog/CL.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/3/x64/Debug/3.tlog/CL.write.1.tlog
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.tlog/CL.write.1.tlog
Обычный файл
Двоичный файл не отображается.
1
3/3/3/x64/Debug/3.tlog/Cl.items.tlog
Обычный файл
1
3/3/3/x64/Debug/3.tlog/Cl.items.tlog
Обычный файл
@@ -0,0 +1 @@
|
|||||||
|
C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\3\3\3\3.cpp;C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\3\3\3\x64\Debug\3.obj
|
||||||
Двоичные данные
3/3/3/x64/Debug/3.tlog/link.command.1.tlog
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.tlog/link.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/3/x64/Debug/3.tlog/link.read.1.tlog
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.tlog/link.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/3/x64/Debug/3.tlog/link.write.1.tlog
Обычный файл
Двоичные данные
3/3/3/x64/Debug/3.tlog/link.write.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/3/x64/Debug/vc143.idb
Обычный файл
Двоичные данные
3/3/3/x64/Debug/vc143.idb
Обычный файл
Двоичный файл не отображается.
Двоичные данные
3/3/x64/Debug/3.exe
Обычный файл
Двоичные данные
3/3/x64/Debug/3.exe
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/.vs/ConsoleApplication3/v17/.suo
Обычный файл
Двоичные данные
4/4/.vs/ConsoleApplication3/v17/.suo
Обычный файл
Двоичный файл не отображается.
31
4/4/ConsoleApplication3.sln
Обычный файл
31
4/4/ConsoleApplication3.sln
Обычный файл
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.8.34316.72
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication3", "ConsoleApplication3\ConsoleApplication3.vcxproj", "{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Release|x64.Build.0 = Release|x64
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{3E250AF3-E0CE-4EA0-A330-30FCA4271CC9}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {927AC36C-CCB3-4FB2-B3F9-D653B77D682C}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
82
4/4/ConsoleApplication3/ConsoleApplication3.cpp
Обычный файл
82
4/4/ConsoleApplication3/ConsoleApplication3.cpp
Обычный файл
@@ -0,0 +1,82 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
bool is_valid_filename(const char* filename) {
|
||||||
|
// Проверка на запрещенные символы
|
||||||
|
if (strpbrk(filename, "*\"<>?|")) return false;
|
||||||
|
|
||||||
|
// Проверка двоеточие
|
||||||
|
const char* colon = strchr(filename, ':');
|
||||||
|
if (colon != nullptr) {
|
||||||
|
if (colon != filename + 1 || !isalpha(filename[0]) || colon[1] != '\\') return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Проверка расширения
|
||||||
|
const char* dot = strrchr(filename, '.');
|
||||||
|
if (dot != nullptr) {
|
||||||
|
if (_stricmp(dot, ".txt") != 0) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int count_occurrences(const char* text, const char* substring) {
|
||||||
|
int count = 0;
|
||||||
|
const char* temp = text;
|
||||||
|
while ((temp = strstr(temp, substring)) != nullptr) {
|
||||||
|
++count;
|
||||||
|
++temp;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char filename[260];
|
||||||
|
std::cout << "Enter filename: ";
|
||||||
|
std::cin.getline(filename, 260);
|
||||||
|
|
||||||
|
if (!is_valid_filename(filename)) {
|
||||||
|
std::cerr << "Invalid filename.\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strrchr(filename, '.') == nullptr) {
|
||||||
|
strcat_s(filename, sizeof(filename), ".txt");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ifstream file(filename, std::ifstream::binary);
|
||||||
|
if (!file) {
|
||||||
|
std::cerr << "Failed to open file.\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
file.seekg(0, std::ifstream::end);
|
||||||
|
long size = file.tellg();
|
||||||
|
file.seekg(0, std::ifstream::beg);
|
||||||
|
|
||||||
|
char* buffer = new char[size + 1];
|
||||||
|
file.read(buffer, size);
|
||||||
|
|
||||||
|
buffer[size] = '\0';
|
||||||
|
|
||||||
|
|
||||||
|
for (long i = 0; i < size; ++i) {
|
||||||
|
if (buffer[i] == '\r' && buffer[i + 1] == '\n') {
|
||||||
|
buffer[i] = '\n';
|
||||||
|
std::memmove(&buffer[i + 1], &buffer[i + 2], size - i - 1);
|
||||||
|
size--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char search_string[100];
|
||||||
|
std::cout << "Enter string to search: ";
|
||||||
|
std::cin.getline(search_string, 100);
|
||||||
|
|
||||||
|
int occurrences = count_occurrences(buffer, search_string);
|
||||||
|
std::cout << "Occurrences of '" << search_string << "': " << occurrences << "\n";
|
||||||
|
|
||||||
|
delete[] buffer;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
135
4/4/ConsoleApplication3/ConsoleApplication3.vcxproj
Обычный файл
135
4/4/ConsoleApplication3/ConsoleApplication3.vcxproj
Обычный файл
@@ -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>{3e250af3-e0ce-4ea0-a330-30fca4271cc9}</ProjectGuid>
|
||||||
|
<RootNamespace>ConsoleApplication3</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="ConsoleApplication3.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
22
4/4/ConsoleApplication3/ConsoleApplication3.vcxproj.filters
Обычный файл
22
4/4/ConsoleApplication3/ConsoleApplication3.vcxproj.filters
Обычный файл
@@ -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="ConsoleApplication3.cpp">
|
||||||
|
<Filter>Исходные файлы</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
4
4/4/ConsoleApplication3/ConsoleApplication3.vcxproj.user
Обычный файл
4
4/4/ConsoleApplication3/ConsoleApplication3.vcxproj.user
Обычный файл
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
||||||
1
4/4/ConsoleApplication3/test.txt
Обычный файл
1
4/4/ConsoleApplication3/test.txt
Обычный файл
@@ -0,0 +1 @@
|
|||||||
|
World
|
||||||
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/CL.command.1.tlog
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/CL.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/CL.read.1.tlog
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/CL.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/CL.write.1.tlog
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/CL.write.1.tlog
Обычный файл
Двоичный файл не отображается.
@@ -0,0 +1 @@
|
|||||||
|
C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\4\4\ConsoleApplication3\ConsoleApplication3.cpp;C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\4\4\ConsoleApplication3\x64\Debug\ConsoleApplication3.obj
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.38.33130:TargetPlatformVersion=10.0.22621.0:
|
||||||
|
Debug|x64|C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\4\4\|
|
||||||
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/link.command.1.tlog
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/link.command.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/link.read.1.tlog
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/link.read.1.tlog
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/link.write.1.tlog
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleA.3e250af3.tlog/link.write.1.tlog
Обычный файл
Двоичный файл не отображается.
11
4/4/ConsoleApplication3/x64/Debug/ConsoleApplication3.exe.recipe
Обычный файл
11
4/4/ConsoleApplication3/x64/Debug/ConsoleApplication3.exe.recipe
Обычный файл
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project>
|
||||||
|
<ProjectOutputs>
|
||||||
|
<ProjectOutput>
|
||||||
|
<FullPath>C:\Users\tikho\Desktop\Учёба\Бакалавриат\2 курс\Разработка ПО СУ\lab03\4\4\x64\Debug\ConsoleApplication3.exe</FullPath>
|
||||||
|
</ProjectOutput>
|
||||||
|
</ProjectOutputs>
|
||||||
|
<ContentFiles />
|
||||||
|
<SatelliteDlls />
|
||||||
|
<NonRecipeFileRefs />
|
||||||
|
</Project>
|
||||||
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleApplication3.ilk
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleApplication3.ilk
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleApplication3.obj
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/ConsoleApplication3.obj
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/vc143.idb
Обычный файл
Двоичные данные
4/4/ConsoleApplication3/x64/Debug/vc143.idb
Обычный файл
Двоичный файл не отображается.
Двоичные данные
4/4/x64/Debug/ConsoleApplication3.exe
Обычный файл
Двоичные данные
4/4/x64/Debug/ConsoleApplication3.exe
Обычный файл
Двоичный файл не отображается.
0
README.md
Обычный файл
0
README.md
Обычный файл
Двоичные данные
lab03.docx
Обычный файл
Двоичные данные
lab03.docx
Обычный файл
Двоичный файл не отображается.
Ссылка в новой задаче
Block a user