diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/.suo b/HW/HW/HWTask_0/.vs/HWTask_0/v16/.suo new file mode 100644 index 00000000..66a4eb66 Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/.suo differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/Browse.VC.db b/HW/HW/HWTask_0/.vs/HWTask_0/v16/Browse.VC.db new file mode 100644 index 00000000..fd84f191 Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/Browse.VC.db differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/10babd8e291a399c/DISLOCOFCIRCLES.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/10babd8e291a399c/DISLOCOFCIRCLES.ipch new file mode 100644 index 00000000..4f03799d Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/10babd8e291a399c/DISLOCOFCIRCLES.ipch differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/3e52686fbbb18d55/DISLOCOFCIRCLES.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/3e52686fbbb18d55/DISLOCOFCIRCLES.ipch new file mode 100644 index 00000000..d8687446 Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/3e52686fbbb18d55/DISLOCOFCIRCLES.ipch differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/61cad31bd609f085/TASK4.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/61cad31bd609f085/TASK4.ipch new file mode 100644 index 00000000..21909359 Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/61cad31bd609f085/TASK4.ipch differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/7e18a059223f323b/TASK4.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/7e18a059223f323b/TASK4.ipch new file mode 100644 index 00000000..a42033e9 Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/7e18a059223f323b/TASK4.ipch differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/a3a7ba9f121f209b/MAIN.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/a3a7ba9f121f209b/MAIN.ipch new file mode 100644 index 00000000..695de18b Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/a3a7ba9f121f209b/MAIN.ipch differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/a8e249687edbb121/DISLOCOFCIRCLES.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/a8e249687edbb121/DISLOCOFCIRCLES.ipch new file mode 100644 index 00000000..81ddb752 Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/a8e249687edbb121/DISLOCOFCIRCLES.ipch differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/e64dd5057081a77f/MAIN.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/e64dd5057081a77f/MAIN.ipch new file mode 100644 index 00000000..e9b5a139 Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/e64dd5057081a77f/MAIN.ipch differ diff --git a/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/e6611810050b57df/DISLOCOFCIRCLES.ipch b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/e6611810050b57df/DISLOCOFCIRCLES.ipch new file mode 100644 index 00000000..a58a4d4e Binary files /dev/null and b/HW/HW/HWTask_0/.vs/HWTask_0/v16/ipch/AutoPCH/e6611810050b57df/DISLOCOFCIRCLES.ipch differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj b/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj new file mode 100644 index 00000000..c22c67ed --- /dev/null +++ b/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {a3e074e8-9556-43e0-ba19-d652ffa4375f} + ArrangementOfCircles + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj.filters b/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj.user b/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/HW/HW/HWTask_0/ArrangementOfCircles/ArrangementOfCircles.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/ArrangementOfCircles.lastbuildstate b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/ArrangementOfCircles.lastbuildstate new file mode 100644 index 00000000..c5ba64cc --- /dev/null +++ b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/ArrangementOfCircles.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\HW\HW\HWTask_0\| diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.command.1.tlog b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.command.1.tlog new file mode 100644 index 00000000..c7c68d03 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.command.1.tlog differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.read.1.tlog b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.read.1.tlog new file mode 100644 index 00000000..60f4e8f0 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.read.1.tlog differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.write.1.tlog b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.write.1.tlog new file mode 100644 index 00000000..fa6300f4 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/CL.write.1.tlog differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.command.1.tlog b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.command.1.tlog new file mode 100644 index 00000000..a3310687 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.command.1.tlog differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.read.1.tlog b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.read.1.tlog new file mode 100644 index 00000000..e4769fb1 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.read.1.tlog differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.write.1.tlog b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.write.1.tlog new file mode 100644 index 00000000..2cb4e5df Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/Arrangem.a3e074e8.tlog/link.write.1.tlog differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.exe.recipe b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.exe.recipe new file mode 100644 index 00000000..ba7284d4 --- /dev/null +++ b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\HW\HW\HWTask_0\Debug\ArrangementOfCircles.exe + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.ilk b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.ilk new file mode 100644 index 00000000..1ece7fec Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.ilk differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.log b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.log new file mode 100644 index 00000000..8519ce6b --- /dev/null +++ b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/ArrangementOfCircles.log @@ -0,0 +1,4 @@ + main.c +C:\git\Informatics-and-Programming\HW\HW\HWTask_0\ArrangementOfCircles\main.c(19,51): warning C4244: функция: преобразование "double" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_0\ArrangementOfCircles\main.c(53,8): warning C4013: _getch: нет определения; предполагается "extern" с возвратом типа "int" + ArrangementOfCircles.vcxproj -> C:\git\Informatics-and-Programming\HW\HW\HWTask_0\Debug\ArrangementOfCircles.exe diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/main.obj b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/main.obj new file mode 100644 index 00000000..b11f0d58 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/main.obj differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/vc142.idb b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/vc142.idb new file mode 100644 index 00000000..8ad85293 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/vc142.idb differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/Debug/vc142.pdb b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/vc142.pdb new file mode 100644 index 00000000..6a8e1c29 Binary files /dev/null and b/HW/HW/HWTask_0/ArrangementOfCircles/Debug/vc142.pdb differ diff --git a/HW/HW/HWTask_0/ArrangementOfCircles/main.c b/HW/HW/HWTask_0/ArrangementOfCircles/main.c new file mode 100644 index 00000000..c51d7049 --- /dev/null +++ b/HW/HW/HWTask_0/ArrangementOfCircles/main.c @@ -0,0 +1,56 @@ +#include +#include +#include + +int main() +{ + + + float x1, x2, y1, y2, r1, r2; + + + printf("Input first circle (x, y, r): "); + scanf_s("%f %f %f", &x1, &y1, &r1); + + printf("Input second circle (x, y, r): "); + scanf_s("%f %f %f", &x2, &y2, &r2); + + + float d = sqrtf(pow(x2 - x1, 2) + pow(y2 - y1, 2)); + + + + if (d == r1 + r2) + { + printf("Kasautsa"); + } + else + { + if (d < r1 + r2) + { + if (d == 0 && r1 == r2) + { + printf("Sovpadayut "); + } + else + { + + if (d + r1 < r2 || d + r2 < r1) + { + printf("Odna v drugoy "); + } + else + { + printf("Peresekautsa"); + } + } + } + if (d > r1 + r2) + { + printf("Ne svazani"); + } + } + _getch(); + return 0; + +} \ No newline at end of file diff --git a/HW/HW/HWTask_0/Debug/ArrangementOfCircles.exe b/HW/HW/HWTask_0/Debug/ArrangementOfCircles.exe new file mode 100644 index 00000000..fa226c15 Binary files /dev/null and b/HW/HW/HWTask_0/Debug/ArrangementOfCircles.exe differ diff --git a/HW/HW/HWTask_0/Debug/ArrangementOfCircles.pdb b/HW/HW/HWTask_0/Debug/ArrangementOfCircles.pdb new file mode 100644 index 00000000..4af4f396 Binary files /dev/null and b/HW/HW/HWTask_0/Debug/ArrangementOfCircles.pdb differ diff --git a/HW/HW/HWTask_0/HWTask_0.sln b/HW/HW/HWTask_0/HWTask_0.sln new file mode 100644 index 00000000..56249e58 --- /dev/null +++ b/HW/HW/HWTask_0/HWTask_0.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ArrangementOfCircles", "ArrangementOfCircles\ArrangementOfCircles.vcxproj", "{A3E074E8-9556-43E0-BA19-D652FFA4375F}" +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 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Debug|x64.ActiveCfg = Debug|x64 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Debug|x64.Build.0 = Debug|x64 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Debug|x86.ActiveCfg = Debug|Win32 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Debug|x86.Build.0 = Debug|Win32 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Release|x64.ActiveCfg = Release|x64 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Release|x64.Build.0 = Release|x64 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Release|x86.ActiveCfg = Release|Win32 + {A3E074E8-9556-43E0-BA19-D652FFA4375F}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {85D508E6-79FD-405B-A3CB-6A0D5CD6D4B7} + EndGlobalSection +EndGlobal diff --git a/HW/HW/HWTask_1/.vs/HWTask_1/v16/.suo b/HW/HW/HWTask_1/.vs/HWTask_1/v16/.suo new file mode 100644 index 00000000..aff80573 Binary files /dev/null and b/HW/HW/HWTask_1/.vs/HWTask_1/v16/.suo differ diff --git a/HW/HW/HWTask_1/.vs/HWTask_1/v16/Browse.VC.db b/HW/HW/HWTask_1/.vs/HWTask_1/v16/Browse.VC.db new file mode 100644 index 00000000..a86b2c11 Binary files /dev/null and b/HW/HW/HWTask_1/.vs/HWTask_1/v16/Browse.VC.db differ diff --git a/HW/HW/HWTask_1/.vs/HWTask_1/v16/ipch/AutoPCH/1dacc4ef5e157953/MAIN.ipch b/HW/HW/HWTask_1/.vs/HWTask_1/v16/ipch/AutoPCH/1dacc4ef5e157953/MAIN.ipch new file mode 100644 index 00000000..0703de6c Binary files /dev/null and b/HW/HW/HWTask_1/.vs/HWTask_1/v16/ipch/AutoPCH/1dacc4ef5e157953/MAIN.ipch differ diff --git a/HW/HW/HWTask_1/.vs/HWTask_1/v16/ipch/AutoPCH/7c820ad87719dae1/MAIN.ipch b/HW/HW/HWTask_1/.vs/HWTask_1/v16/ipch/AutoPCH/7c820ad87719dae1/MAIN.ipch new file mode 100644 index 00000000..6d65589d Binary files /dev/null and b/HW/HW/HWTask_1/.vs/HWTask_1/v16/ipch/AutoPCH/7c820ad87719dae1/MAIN.ipch differ diff --git a/HW/HW/HWTask_1/Debug/WardrobeWeight.exe b/HW/HW/HWTask_1/Debug/WardrobeWeight.exe new file mode 100644 index 00000000..e540e224 Binary files /dev/null and b/HW/HW/HWTask_1/Debug/WardrobeWeight.exe differ diff --git a/HW/HW/HWTask_1/Debug/WardrobeWeight.pdb b/HW/HW/HWTask_1/Debug/WardrobeWeight.pdb new file mode 100644 index 00000000..9b2a2d2f Binary files /dev/null and b/HW/HW/HWTask_1/Debug/WardrobeWeight.pdb differ diff --git a/HW/HW/HWTask_1/HWTask_1.sln b/HW/HW/HWTask_1/HWTask_1.sln new file mode 100644 index 00000000..cec0ca84 --- /dev/null +++ b/HW/HW/HWTask_1/HWTask_1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WardrobeWeight", "WardrobeWeight\WardrobeWeight.vcxproj", "{C684929C-C42B-4B37-99CB-BDF2808CC42B}" +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 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Debug|x64.ActiveCfg = Debug|x64 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Debug|x64.Build.0 = Debug|x64 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Debug|x86.ActiveCfg = Debug|Win32 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Debug|x86.Build.0 = Debug|Win32 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Release|x64.ActiveCfg = Release|x64 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Release|x64.Build.0 = Release|x64 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Release|x86.ActiveCfg = Release|Win32 + {C684929C-C42B-4B37-99CB-BDF2808CC42B}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A266DBB1-E48A-4266-BA8F-5E78C5B342F4} + EndGlobalSection +EndGlobal diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.exe.recipe b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.exe.recipe new file mode 100644 index 00000000..11dec0f0 --- /dev/null +++ b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\HW\HW\HWTask_1\Debug\WardrobeWeight.exe + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.ilk b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.ilk new file mode 100644 index 00000000..5fdd15ee Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.ilk differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.log b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.log new file mode 100644 index 00000000..8ba3a830 --- /dev/null +++ b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.log @@ -0,0 +1,8 @@ + main.c +C:\git\Informatics-and-Programming\HW\HW\HWTask_1\WardrobeWeight\main.c(51,8): warning C4013: _getch: нет определения; предполагается "extern" с возвратом типа "int" +C:\git\Informatics-and-Programming\HW\HW\HWTask_1\WardrobeWeight\main.c(9,161): warning C4101: a: неиспользованная локальная переменная +C:\git\Informatics-and-Programming\HW\HW\HWTask_1\WardrobeWeight\main.c(9,91): warning C4101: tops: неиспользованная локальная переменная +C:\git\Informatics-and-Programming\HW\HW\HWTask_1\WardrobeWeight\main.c(9,66): warning C4101: SideWalls: неиспользованная локальная переменная +C:\git\Informatics-and-Programming\HW\HW\HWTask_1\WardrobeWeight\main.c(9,56): warning C4101: BackWall: неиспользованная локальная переменная +C:\git\Informatics-and-Programming\HW\HW\HWTask_1\WardrobeWeight\main.c(9,77): warning C4101: doors: неиспользованная локальная переменная + WardrobeWeight.vcxproj -> C:\git\Informatics-and-Programming\HW\HW\HWTask_1\Debug\WardrobeWeight.exe diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.command.1.tlog b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.command.1.tlog new file mode 100644 index 00000000..5aee3259 Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.command.1.tlog differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.read.1.tlog b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.read.1.tlog new file mode 100644 index 00000000..c2e406ab Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.read.1.tlog differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.write.1.tlog b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.write.1.tlog new file mode 100644 index 00000000..5b5c0874 Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/CL.write.1.tlog differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/WardrobeWeight.lastbuildstate b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/WardrobeWeight.lastbuildstate new file mode 100644 index 00000000..1c74172c --- /dev/null +++ b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/WardrobeWeight.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\HW\HW\HWTask_1\| diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.command.1.tlog b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.command.1.tlog new file mode 100644 index 00000000..83766f95 Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.command.1.tlog differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.read.1.tlog b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.read.1.tlog new file mode 100644 index 00000000..8b7af31e Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.read.1.tlog differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.write.1.tlog b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.write.1.tlog new file mode 100644 index 00000000..fdd6168c Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/WardrobeWeight.tlog/link.write.1.tlog differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/main.obj b/HW/HW/HWTask_1/WardrobeWeight/Debug/main.obj new file mode 100644 index 00000000..5ce86836 Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/main.obj differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/vc142.idb b/HW/HW/HWTask_1/WardrobeWeight/Debug/vc142.idb new file mode 100644 index 00000000..42785028 Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/vc142.idb differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/Debug/vc142.pdb b/HW/HW/HWTask_1/WardrobeWeight/Debug/vc142.pdb new file mode 100644 index 00000000..df3d237c Binary files /dev/null and b/HW/HW/HWTask_1/WardrobeWeight/Debug/vc142.pdb differ diff --git a/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj b/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj new file mode 100644 index 00000000..288295a0 --- /dev/null +++ b/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {c684929c-c42b-4b37-99cb-bdf2808cc42b} + WardrobeWeight + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj.filters b/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj.user b/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/HW/HW/HWTask_1/WardrobeWeight/WardrobeWeight.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_1/WardrobeWeight/main.c b/HW/HW/HWTask_1/WardrobeWeight/main.c new file mode 100644 index 00000000..b8ad9e2a --- /dev/null +++ b/HW/HW/HWTask_1/WardrobeWeight/main.c @@ -0,0 +1,53 @@ +#include +#include +#include + +int main() +{ + setlocale(LC_CTYPE, "Russian"); + + double Den_DSP = 700, Den_DVP = 300, Den_Wood = 1000, BackWall, SideWalls, doors, racks, tops, thickness_15 = 0.015, thickness_5 = 0.005, thickness_10 = 0.01, a, h, w, d, LockerWeight; + + printf("Введите данные шкафа(высота от 1.8м до 2.2м и ширина от 0.8м до 1.2м): "); + scanf_s("%lf %lf", &h, &w); + if (1.8 <= h && h <= 2.2 && 0.8 <= w && w <= 1.2) + { + + printf("Введите данные(глубина от 0.5м до 0.9м): "); + scanf_s("%lf", &d); + if (0.5 <= d && d <= 0.9) + { + + LockerWeight = ((h * w * thickness_5) * Den_DVP) + (((h * d * thickness_15) * Den_DSP) * 2) + ((w * d * thickness_15) * Den_DSP) + ((h * w * thickness_10) * Den_Wood); + if (h <= 2) + { + racks = 4; + + LockerWeight = LockerWeight + ((w * d * thickness_15) * Den_DSP) * racks; + + printf("Вес шкафа: %.2lf", LockerWeight); + } + else + { + racks = 5; + + LockerWeight = LockerWeight + ((w * d * thickness_15) * Den_DSP) * racks; + + printf("Вес шкафа: %.2lf", LockerWeight); + + } + + } + else + { + printf("Введены некорректные данные!!!"); + } + + } + else + { + printf("Введены некорректные данные!!!"); + } + _getch(); + return 0; +} \ No newline at end of file diff --git a/HW/HW/HWTask_2/.vs/HWTask_2/v16/.suo b/HW/HW/HWTask_2/.vs/HWTask_2/v16/.suo new file mode 100644 index 00000000..6b385cca Binary files /dev/null and b/HW/HW/HWTask_2/.vs/HWTask_2/v16/.suo differ diff --git a/HW/HW/HWTask_2/.vs/HWTask_2/v16/Browse.VC.db b/HW/HW/HWTask_2/.vs/HWTask_2/v16/Browse.VC.db new file mode 100644 index 00000000..50b84d20 Binary files /dev/null and b/HW/HW/HWTask_2/.vs/HWTask_2/v16/Browse.VC.db differ diff --git a/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/75bc26f6d2fc0dad/MAIN.ipch b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/75bc26f6d2fc0dad/MAIN.ipch new file mode 100644 index 00000000..eafc17fd Binary files /dev/null and b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/75bc26f6d2fc0dad/MAIN.ipch differ diff --git a/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/8395720a9dddfbac/MAIN.ipch b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/8395720a9dddfbac/MAIN.ipch new file mode 100644 index 00000000..9431a799 Binary files /dev/null and b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/8395720a9dddfbac/MAIN.ipch differ diff --git a/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/8c01cc38f6ae1933/MAIN.ipch b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/8c01cc38f6ae1933/MAIN.ipch new file mode 100644 index 00000000..8273950b Binary files /dev/null and b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/8c01cc38f6ae1933/MAIN.ipch differ diff --git a/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/c9ab4b2a0f4f3238/MAIN.ipch b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/c9ab4b2a0f4f3238/MAIN.ipch new file mode 100644 index 00000000..fca3e3b4 Binary files /dev/null and b/HW/HW/HWTask_2/.vs/HWTask_2/v16/ipch/AutoPCH/c9ab4b2a0f4f3238/MAIN.ipch differ diff --git a/HW/HW/HWTask_2/Debug/GuessTheNumber.exe b/HW/HW/HWTask_2/Debug/GuessTheNumber.exe new file mode 100644 index 00000000..9118f79a Binary files /dev/null and b/HW/HW/HWTask_2/Debug/GuessTheNumber.exe differ diff --git a/HW/HW/HWTask_2/Debug/GuessTheNumber.pdb b/HW/HW/HWTask_2/Debug/GuessTheNumber.pdb new file mode 100644 index 00000000..37ba5a44 Binary files /dev/null and b/HW/HW/HWTask_2/Debug/GuessTheNumber.pdb differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.exe.recipe b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.exe.recipe new file mode 100644 index 00000000..230333d6 --- /dev/null +++ b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\HW\HW\HWTask_2\Debug\GuessTheNumber.exe + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.ilk b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.ilk new file mode 100644 index 00000000..1042dd70 Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.ilk differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.log b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.log new file mode 100644 index 00000000..85eb7952 --- /dev/null +++ b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.log @@ -0,0 +1,10 @@ + main.c +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(19,17): warning C4244: функция: преобразование "time_t" в "unsigned int", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(62,13): warning C4473: "scanf_s": передано недостаточно аргументов для строки формата +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(62,13): message : заполнители и их параметры ожидают переменное число аргументов в количестве 2, но было предоставлено 1 +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(62,13): message : отсутствующий вариативный аргумент "2" требуется для строки форматирования "%c" +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(62,13): message : этот аргумент используется в качестве размера буфера +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(64,26): warning C4244: =: преобразование "double" в "int", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(109,8): warning C4013: _getch: нет определения; предполагается "extern" с возвратом типа "int" +C:\git\Informatics-and-Programming\HW\HW\HWTask_2\GuessTheNumber\main.c(57,41): warning C4101: User_Number_2: неиспользованная локальная переменная + GuessTheNumber.vcxproj -> C:\git\Informatics-and-Programming\HW\HW\HWTask_2\Debug\GuessTheNumber.exe diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.command.1.tlog b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.command.1.tlog new file mode 100644 index 00000000..92295cab Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.command.1.tlog differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.read.1.tlog b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.read.1.tlog new file mode 100644 index 00000000..a0449510 Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.read.1.tlog differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.write.1.tlog b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.write.1.tlog new file mode 100644 index 00000000..f2b1bcad Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/CL.write.1.tlog differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/GuessTheNumber.lastbuildstate b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/GuessTheNumber.lastbuildstate new file mode 100644 index 00000000..8981d733 --- /dev/null +++ b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/GuessTheNumber.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\HW\HW\HWTask_2\| diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.command.1.tlog b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.command.1.tlog new file mode 100644 index 00000000..db9404bd Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.command.1.tlog differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.read.1.tlog b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.read.1.tlog new file mode 100644 index 00000000..68248c77 Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.read.1.tlog differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.write.1.tlog b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.write.1.tlog new file mode 100644 index 00000000..9d919193 Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/GuessTheNumber.tlog/link.write.1.tlog differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/main.obj b/HW/HW/HWTask_2/GuessTheNumber/Debug/main.obj new file mode 100644 index 00000000..5e8e06ed Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/main.obj differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/vc142.idb b/HW/HW/HWTask_2/GuessTheNumber/Debug/vc142.idb new file mode 100644 index 00000000..20b698bb Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/vc142.idb differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/Debug/vc142.pdb b/HW/HW/HWTask_2/GuessTheNumber/Debug/vc142.pdb new file mode 100644 index 00000000..7045186b Binary files /dev/null and b/HW/HW/HWTask_2/GuessTheNumber/Debug/vc142.pdb differ diff --git a/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj b/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj new file mode 100644 index 00000000..d9f55cc5 --- /dev/null +++ b/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {4cece5a8-9324-4198-96ff-9e340d86f98a} + GuessTheNumber + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj.filters b/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj.user b/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/HW/HW/HWTask_2/GuessTheNumber/GuessTheNumber.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_2/GuessTheNumber/main.c b/HW/HW/HWTask_2/GuessTheNumber/main.c new file mode 100644 index 00000000..9b0d16ec --- /dev/null +++ b/HW/HW/HWTask_2/GuessTheNumber/main.c @@ -0,0 +1,111 @@ +#include +#include +#include +#include + +int main() { + + setlocale(LC_ALL, "Russian"); + int PC_Number_1, User_Number_1, mode, NumberOfAttempts; + NumberOfAttempts = 0; + + printf (" :\n1 - \n2 - \n : "); + scanf_s("%d", &mode); + + switch (mode) + { + case 1: + { + srand(time(0)); + PC_Number_1 = rand() % 1000; + + do + { + printf (" , ( 1 1000): "); + scanf_s("%d", &User_Number_1); + + + if (PC_Number_1 == User_Number_1) + { + printf(" !"); + NumberOfAttempts++; + printf("\n : %d", NumberOfAttempts); + } + else + { + if (PC_Number_1 < User_Number_1) + { + printf(" \n"); + NumberOfAttempts++; + } + else + { + if (PC_Number_1 > User_Number_1) + { + printf(" \n"); + NumberOfAttempts++; + } + } + } + } while (PC_Number_1 != User_Number_1); + break; + } + + case 2: + { + char sign; + int change = 500, PC_Number_2 = 500, User_Number_2; + printf (" 1 1000.\n '='\n '>'\n '<'"); + do + { + printf ("\n :%d ?\n", PC_Number_2); + scanf_s("%ch", &sign); + + change = change * 0.9; + if (change < 1) change = 1; + + if (PC_Number_2 > 1000) PC_Number_2 = 1000; + + if (PC_Number_2 < 1) PC_Number_2 = 1; + + if (sign == '=') + { + printf("\n !"); + NumberOfAttempts++; + printf("\n : %d", NumberOfAttempts); + } + else + { + if (sign == '>') + { + printf("\n ."); + PC_Number_2 = PC_Number_2 - change; + NumberOfAttempts++; + } + else + { + if (sign == '<') + { + PC_Number_2 = PC_Number_2 + change; + NumberOfAttempts++; + } + } + } + + } while (sign != '='); + break; + } + + + default: + { + printf(" 1 2, ."); + break; + } + + } + + + _getch(); + return 0; +} \ No newline at end of file diff --git a/HW/HW/HWTask_2/HWTask_2.sln b/HW/HW/HWTask_2/HWTask_2.sln new file mode 100644 index 00000000..2eacb882 --- /dev/null +++ b/HW/HW/HWTask_2/HWTask_2.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GuessTheNumber", "GuessTheNumber\GuessTheNumber.vcxproj", "{4CECE5A8-9324-4198-96FF-9E340D86F98A}" +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 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Debug|x64.ActiveCfg = Debug|x64 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Debug|x64.Build.0 = Debug|x64 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Debug|x86.ActiveCfg = Debug|Win32 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Debug|x86.Build.0 = Debug|Win32 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Release|x64.ActiveCfg = Release|x64 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Release|x64.Build.0 = Release|x64 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Release|x86.ActiveCfg = Release|Win32 + {4CECE5A8-9324-4198-96FF-9E340D86F98A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AE276289-6E73-405B-B081-DE014EAC1A32} + EndGlobalSection +EndGlobal diff --git a/HW/HW/HWTask_3/.vs/HWTask_3/v16/.suo b/HW/HW/HWTask_3/.vs/HWTask_3/v16/.suo new file mode 100644 index 00000000..3387d921 Binary files /dev/null and b/HW/HW/HWTask_3/.vs/HWTask_3/v16/.suo differ diff --git a/HW/HW/HWTask_3/.vs/HWTask_3/v16/Browse.VC.db b/HW/HW/HWTask_3/.vs/HWTask_3/v16/Browse.VC.db new file mode 100644 index 00000000..dc1c20fa Binary files /dev/null and b/HW/HW/HWTask_3/.vs/HWTask_3/v16/Browse.VC.db differ diff --git a/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6502149941617057/MAIN.ipch b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6502149941617057/MAIN.ipch new file mode 100644 index 00000000..3fe96402 Binary files /dev/null and b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6502149941617057/MAIN.ipch differ diff --git a/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6668400532f889af/TASK4 (1).ipch b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6668400532f889af/TASK4 (1).ipch new file mode 100644 index 00000000..8a73cc05 Binary files /dev/null and b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6668400532f889af/TASK4 (1).ipch differ diff --git a/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6d64f1a2821c98d7/MAIN.ipch b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6d64f1a2821c98d7/MAIN.ipch new file mode 100644 index 00000000..cbbefd9e Binary files /dev/null and b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/6d64f1a2821c98d7/MAIN.ipch differ diff --git a/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/7b61a551391b8ba6/MAIN.ipch b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/7b61a551391b8ba6/MAIN.ipch new file mode 100644 index 00000000..61ac9006 Binary files /dev/null and b/HW/HW/HWTask_3/.vs/HWTask_3/v16/ipch/AutoPCH/7b61a551391b8ba6/MAIN.ipch differ diff --git a/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj b/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj new file mode 100644 index 00000000..54eb8a3b --- /dev/null +++ b/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {7aedc67a-0b80-41ee-b1b2-f0cce0d7356d} + Bullsandcows + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj.filters b/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj.user b/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/HW/HW/HWTask_3/Bulls and cows/Bulls and cows.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_3/Bulls and cows/main.c b/HW/HW/HWTask_3/Bulls and cows/main.c new file mode 100644 index 00000000..27b92cf5 --- /dev/null +++ b/HW/HW/HWTask_3/Bulls and cows/main.c @@ -0,0 +1,105 @@ +#include +#include +#include +#include +#include + + +int main() +{ + setlocale(LC_ALL, "Russian"); + + int* crand = NULL, leght = 0, user_num = 0, digit = 0, * user_numarr = NULL, user_numfarr = 0, f = 0, cows = 0, bulls = 0, f1 = 0; + + printf(" !\n \n Bulls + 1, Cows + 1\n\n"); + printf(" , - .\n!!! 0 \n\n"); + printf(" 2 5: "); + scanf_s("%d", &leght); + if (leght >= 2 && leght <= 5) + { + srand(time(NULL)); + crand = (int*)malloc(leght * sizeof(int*)); + user_numarr = (int*)malloc(leght * sizeof(int*)); + + for(int i = 0; i < leght; ) + { + int f = 0; + int MASS_Rand_Value = rand() % 9 + 1; + + for (int j = 0; j < i; j++) + { + if(crand[j] == MASS_Rand_Value) + { + f = 1; + break; + } + } + + if (f == 0) + { + crand[i] = MASS_Rand_Value; + i++; + } + + } + + for (int i = 0; i < leght; i++) + { + printf("%d ", crand[i]); + } + + while(bulls != leght) + { + + printf("\n\n , ."); + printf("\n ( ): "); + scanf_s("%d", &user_num); + user_numfarr = user_num; + while (user_num % 10 != 0) + { + user_num /= 10; + digit++; + } + if (digit == leght) + { + bulls = 0; + cows = 0; + + for (int i = digit - 1 ; 0 <= i; i--) + { + user_numarr[i] = user_numfarr % 10; + user_numfarr /= 10; + } + + for (int i = 0; i < digit; i++) + { + if(crand[i] == user_numarr[i]) + { + bulls += 1; + } + for (int j = 0; j < digit; j++) + { + if(crand[i] == user_numarr[j] && i != j) + { + cows += 1; + } + } + } + printf("\nBulls = %d", bulls); + printf("\nCows = %d", cows); + + } + else + { + printf("\n ( ) ..."); + } + digit = 0; + } + printf("\n !!!"); + } + else + { + printf(" 2 5 !!!"); + } + return 0; +} \ No newline at end of file diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.exe.recipe b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.exe.recipe new file mode 100644 index 00000000..9a93002e --- /dev/null +++ b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\HW\HW\HWTask_3\x64\Debug\Bulls and cows.exe + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.ilk b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.ilk new file mode 100644 index 00000000..759e9e16 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.ilk differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.log b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.log new file mode 100644 index 00000000..5b3626b2 --- /dev/null +++ b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.log @@ -0,0 +1,4 @@ + main.c +C:\git\Informatics-and-Programming\HW\HW\HWTask_3\Bulls and cows\main.c(20,8): warning C4013: srand: нет определения; предполагается "extern" с возвратом типа "int" +C:\git\Informatics-and-Programming\HW\HW\HWTask_3\Bulls and cows\main.c(27,30): warning C4013: rand: нет определения; предполагается "extern" с возвратом типа "int" + Bulls and cows.vcxproj -> C:\git\Informatics-and-Programming\HW\HW\HWTask_3\x64\Debug\Bulls and cows.exe diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/Bulls and cows.lastbuildstate b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/Bulls and cows.lastbuildstate new file mode 100644 index 00000000..3d9faf1c --- /dev/null +++ b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/Bulls and cows.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|x64|C:\git\Informatics-and-Programming\HW\HW\HWTask_3\| diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.command.1.tlog b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.command.1.tlog new file mode 100644 index 00000000..a6a57a7b Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.command.1.tlog differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.read.1.tlog b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.read.1.tlog new file mode 100644 index 00000000..237c3f40 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.read.1.tlog differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.write.1.tlog b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.write.1.tlog new file mode 100644 index 00000000..261ec121 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/CL.write.1.tlog differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.command.1.tlog b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.command.1.tlog new file mode 100644 index 00000000..163a0443 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.command.1.tlog differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.read.1.tlog b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.read.1.tlog new file mode 100644 index 00000000..125ead38 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.read.1.tlog differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.write.1.tlog b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.write.1.tlog new file mode 100644 index 00000000..79eb1062 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/Bulls and cows.tlog/link.write.1.tlog differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/main.obj b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/main.obj new file mode 100644 index 00000000..e6562570 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/main.obj differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/main.obj.enc b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/main.obj.enc new file mode 100644 index 00000000..7642d015 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/main.obj.enc differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/vc142.idb b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/vc142.idb new file mode 100644 index 00000000..5670f837 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/vc142.idb differ diff --git a/HW/HW/HWTask_3/Bulls and cows/x64/Debug/vc142.pdb b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/vc142.pdb new file mode 100644 index 00000000..d12fd168 Binary files /dev/null and b/HW/HW/HWTask_3/Bulls and cows/x64/Debug/vc142.pdb differ diff --git a/HW/HW/HWTask_3/HWTask_3.sln b/HW/HW/HWTask_3/HWTask_3.sln new file mode 100644 index 00000000..4754c120 --- /dev/null +++ b/HW/HW/HWTask_3/HWTask_3.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bulls and cows", "Bulls and cows\Bulls and cows.vcxproj", "{7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}" +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 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Debug|x64.ActiveCfg = Debug|x64 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Debug|x64.Build.0 = Debug|x64 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Debug|x86.ActiveCfg = Debug|Win32 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Debug|x86.Build.0 = Debug|Win32 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Release|x64.ActiveCfg = Release|x64 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Release|x64.Build.0 = Release|x64 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Release|x86.ActiveCfg = Release|Win32 + {7AEDC67A-0B80-41EE-B1B2-F0CCE0D7356D}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {43ADF3E8-402A-4920-8729-AA947AC9F21C} + EndGlobalSection +EndGlobal diff --git a/HW/HW/HWTask_3/x64/Debug/Bulls and cows.exe b/HW/HW/HWTask_3/x64/Debug/Bulls and cows.exe new file mode 100644 index 00000000..18f8f30c Binary files /dev/null and b/HW/HW/HWTask_3/x64/Debug/Bulls and cows.exe differ diff --git a/HW/HW/HWTask_3/x64/Debug/Bulls and cows.pdb b/HW/HW/HWTask_3/x64/Debug/Bulls and cows.pdb new file mode 100644 index 00000000..69d90f59 Binary files /dev/null and b/HW/HW/HWTask_3/x64/Debug/Bulls and cows.pdb differ diff --git a/HW/HW/HWTask_4/.vs/HWTask_4/v16/.suo b/HW/HW/HWTask_4/.vs/HWTask_4/v16/.suo new file mode 100644 index 00000000..549d6325 Binary files /dev/null and b/HW/HW/HWTask_4/.vs/HWTask_4/v16/.suo differ diff --git a/HW/HW/HWTask_4/.vs/HWTask_4/v16/Browse.VC.db b/HW/HW/HWTask_4/.vs/HWTask_4/v16/Browse.VC.db new file mode 100644 index 00000000..b680c4dd Binary files /dev/null and b/HW/HW/HWTask_4/.vs/HWTask_4/v16/Browse.VC.db differ diff --git a/HW/HW/HWTask_4/.vs/HWTask_4/v16/ipch/AutoPCH/d544bcafea53ab85/MAIN.ipch b/HW/HW/HWTask_4/.vs/HWTask_4/v16/ipch/AutoPCH/d544bcafea53ab85/MAIN.ipch new file mode 100644 index 00000000..f8c960b7 Binary files /dev/null and b/HW/HW/HWTask_4/.vs/HWTask_4/v16/ipch/AutoPCH/d544bcafea53ab85/MAIN.ipch differ diff --git a/HW/HW/HWTask_4/.vs/HWTask_4/v16/ipch/AutoPCH/dd50471ca7bd31/MAIN.ipch b/HW/HW/HWTask_4/.vs/HWTask_4/v16/ipch/AutoPCH/dd50471ca7bd31/MAIN.ipch new file mode 100644 index 00000000..6f0f9815 Binary files /dev/null and b/HW/HW/HWTask_4/.vs/HWTask_4/v16/ipch/AutoPCH/dd50471ca7bd31/MAIN.ipch differ diff --git a/HW/HW/HWTask_4/Debug/ElectronicCashRegister.exe b/HW/HW/HWTask_4/Debug/ElectronicCashRegister.exe new file mode 100644 index 00000000..1d7db0d4 Binary files /dev/null and b/HW/HW/HWTask_4/Debug/ElectronicCashRegister.exe differ diff --git a/HW/HW/HWTask_4/Debug/ElectronicCashRegister.pdb b/HW/HW/HWTask_4/Debug/ElectronicCashRegister.pdb new file mode 100644 index 00000000..72445cf6 Binary files /dev/null and b/HW/HW/HWTask_4/Debug/ElectronicCashRegister.pdb differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.command.1.tlog b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.command.1.tlog new file mode 100644 index 00000000..12142533 Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.command.1.tlog differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.read.1.tlog b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.read.1.tlog new file mode 100644 index 00000000..e6dc1957 Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.read.1.tlog differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.write.1.tlog b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.write.1.tlog new file mode 100644 index 00000000..70667794 Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/CL.write.1.tlog differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/ElectronicCashRegister.lastbuildstate b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/ElectronicCashRegister.lastbuildstate new file mode 100644 index 00000000..c8af892c --- /dev/null +++ b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/ElectronicCashRegister.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\HW\HW\HWTask_4\| diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.command.1.tlog b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.command.1.tlog new file mode 100644 index 00000000..8a42bc7d Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.command.1.tlog differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.read.1.tlog b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.read.1.tlog new file mode 100644 index 00000000..42dd6426 Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.read.1.tlog differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.write.1.tlog b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.write.1.tlog new file mode 100644 index 00000000..84cf002a Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/Electron.b41111ac.tlog/link.write.1.tlog differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.exe.recipe b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.exe.recipe new file mode 100644 index 00000000..4239134b --- /dev/null +++ b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\HW\HW\HWTask_4\Debug\ElectronicCashRegister.exe + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.ilk b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.ilk new file mode 100644 index 00000000..3425fa1d Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.ilk differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.log b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.log new file mode 100644 index 00000000..06918dc0 --- /dev/null +++ b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/ElectronicCashRegister.log @@ -0,0 +1,8 @@ + main.c +C:\git\Informatics-and-Programming\HW\HW\HWTask_4\ElectronicCashRegister\main.c(41,15): warning C4244: функция: преобразование "time_t" в "unsigned int", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_4\ElectronicCashRegister\main.c(65,21): warning C4244: =: преобразование "int" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_4\ElectronicCashRegister\main.c(66,21): warning C4244: =: преобразование "int" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_4\ElectronicCashRegister\main.c(67,24): warning C4244: =: преобразование "int" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_4\ElectronicCashRegister\main.c(68,21): warning C4244: =: преобразование "int" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\HW\HW\HWTask_4\ElectronicCashRegister\main.c(43,48): warning C4101: type: неиспользованная локальная переменная + ElectronicCashRegister.vcxproj -> C:\git\Informatics-and-Programming\HW\HW\HWTask_4\Debug\ElectronicCashRegister.exe diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/main.obj b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/main.obj new file mode 100644 index 00000000..41d905a9 Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/main.obj differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/vc142.idb b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/vc142.idb new file mode 100644 index 00000000..9e6e99bf Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/vc142.idb differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/Debug/vc142.pdb b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/vc142.pdb new file mode 100644 index 00000000..f9cf207f Binary files /dev/null and b/HW/HW/HWTask_4/ElectronicCashRegister/Debug/vc142.pdb differ diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj b/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj new file mode 100644 index 00000000..c8805ba8 --- /dev/null +++ b/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {b41111ac-eeb4-4207-9ea9-302aad32ed68} + ElectronicCashRegister + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj.filters b/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj.user b/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/HW/HW/HWTask_4/ElectronicCashRegister/ElectronicCashRegister.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_4/ElectronicCashRegister/main.c b/HW/HW/HWTask_4/ElectronicCashRegister/main.c new file mode 100644 index 00000000..4abffe4d --- /dev/null +++ b/HW/HW/HWTask_4/ElectronicCashRegister/main.c @@ -0,0 +1,225 @@ +#include +#include +#include +#include +#include +#include + +#define ARRSIZE 4 + +void producti(int* sht) +{ + printf("\n------------------------------------------------------------------------------\n"); + printf("RTX3060 : %d", sht[0]); + printf("\n------------------------------------------------------------------------------\n"); + printf("RadRX6600 : %d", sht[1]); + printf("\n------------------------------------------------------------------------------\n"); + printf("Gigabyte : %d", sht[2]); + printf("\n------------------------------------------------------------------------------\n"); + printf("ASUSROG : %d", sht[3]); + printf("\n------------------------------------------------------------------------------\n\n"); +} + +void info(float sale, int count, float price_sale) +{ + printf("\n\t %0.1f %%", sale); + printf("\n\t %d .", count); + printf("\n\t %0.1f .", price_sale); +} + + +int main() +{ + setlocale(LC_ALL, "RUSSIAN"); + srand(time(0)); + + int fs, option = 0, shtrihr, sht_stop = 0, f; + float itog = 0; + + + char* tovar[ARRSIZE]; + + tovar[0] = "RTX3060"; + tovar[1] = "RadRX6600"; + tovar[2] = "Gigabyte"; + tovar[3] = "ASUSROG"; + + int* flag; + flag = (float*)malloc(ARRSIZE * sizeof(float)); + + int* count; + count = (float*)malloc(ARRSIZE * sizeof(float)); + + int* sht; + sht = (float*)malloc(ARRSIZE * sizeof(float)); + + int* price; + price = (float*)malloc(ARRSIZE * sizeof(float)); + + price[0] = 60000; + price[1] = 50000; + price[2] = 20000; + price[3] = 25000; + + float* sale; + sale = (float*)malloc(ARRSIZE * sizeof(float)); + + float* prices; + prices = (float*)malloc(ARRSIZE * sizeof(float)); + + for (int i = 0; i < ARRSIZE; i++) + { + sale[i] = rand() % 50; + prices[i] = price[i] * (1 - (sale[i] / 100)); + sht[i] = 0; + flag[i] = 0; + } + + int** shtrih = NULL; + shtrih = (int**)malloc(ARRSIZE * sizeof(int*)); + for (int i = 0; i < ARRSIZE; i++) + shtrih[i] = (int*)malloc(ARRSIZE * sizeof(int)); + + printf(" \n\n"); + printf(" : \n"); + + sht_stop = 1000; + for (int i = 0; i < ARRSIZE; i++) { + for (int j = 0; j < ARRSIZE; j++) + { + shtrih[i][j] = rand() % 9 + 1; + sht[i] = (shtrih[i][j] * sht_stop) + sht[i]; + sht_stop /= 10; + } + sht_stop = 1000; + } + + producti(sht); + + printf(" - <1>\n"); + printf(" - <2>\n"); + printf(" -<3>\n"); + printf(" - <4>\n"); + printf(" - <5>\n"); + printf(" - <6>\n"); + printf("\n"); + do + { + printf("\n------------------------------------------------------------------------------"); + printf("\n :"); + scanf_s("%d", &option); + + + switch (option) + { + case 1: + { + do + { + fs = 0; + printf("\n :"); + scanf_s("%d", &shtrihr); + + for (int i = 0; i < ARRSIZE; i++) + { + if (shtrihr == sht[i]) + { + printf("\n "); + f = i + 1; + } + } + + if (shtrihr == sht[0] && shtrihr == sht[1] && shtrihr == sht[2] && shtrihr == sht[3]) + fs = 1; + } while (fs == 1); + + break; + } + + case 2: + { + if (f > 0 && f < 5) + { + printf("\n%s %d .", tovar[f - 1], price[f - 1]); + printf("\n %0.0f %%", sale[f - 1]); + } + else + { + printf(" "); + } + + break; + } + + case 3: + { + if (f < 5 && f > 0) + { + printf(" , :"); + scanf_s("%d", &count[f - 1]); + flag[f - 1] = 1; + printf("\n "); + } + else + { + printf(" "); + } + break; + } + + case 4: + { printf("\n\t\t"); + for (int i = 0; i < ARRSIZE; i++) + if (flag[i] == 1) + { + prices[i] = prices[i] * count[i]; + printf("\n%s", tovar[i]); + info(sale[i], count[i], prices[i]); + } + + if ((flag[0] == 0) && (flag[1] == 0) && (flag[2] == 0) && (flag[3] == 0)) + { + printf("\n\t* *"); + } + + break; + } + + case 5: + { + printf("\n\t\t()"); + + for (int i = 0; i < ARRSIZE; i++) + { + if (flag[i] == 1) + { + printf("\n%s", tovar[i]); + info(sale[i], count[i], prices[i]); + } + else + { + prices[i] = 0; + } + itog += prices[i]; + } + + printf("\n\n\n: %.1f ", itog); + + break; + } + + case 6: + { + producti(sht); + break; + } + default: + { + printf(" ! 1 6 "); + } + break; + } + } while (option != 5); + _getch(); + return 0; +} \ No newline at end of file diff --git a/HW/HW/HWTask_4/HWTask_4.sln b/HW/HW/HWTask_4/HWTask_4.sln new file mode 100644 index 00000000..2d1b8f40 --- /dev/null +++ b/HW/HW/HWTask_4/HWTask_4.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ElectronicCashRegister", "ElectronicCashRegister\ElectronicCashRegister.vcxproj", "{B41111AC-EEB4-4207-9EA9-302AAD32ED68}" +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 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Debug|x64.ActiveCfg = Debug|x64 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Debug|x64.Build.0 = Debug|x64 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Debug|x86.ActiveCfg = Debug|Win32 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Debug|x86.Build.0 = Debug|Win32 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Release|x64.ActiveCfg = Release|x64 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Release|x64.Build.0 = Release|x64 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Release|x86.ActiveCfg = Release|Win32 + {B41111AC-EEB4-4207-9EA9-302AAD32ED68}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {082F9A63-F6E8-4BA3-833F-C66462880A16} + EndGlobalSection +EndGlobal diff --git a/HW/HW/HWTask_5/.vs/HWTask_5/v16/.suo b/HW/HW/HWTask_5/.vs/HWTask_5/v16/.suo new file mode 100644 index 00000000..97e7601d Binary files /dev/null and b/HW/HW/HWTask_5/.vs/HWTask_5/v16/.suo differ diff --git a/HW/HW/HWTask_5/.vs/HWTask_5/v16/Browse.VC.db b/HW/HW/HWTask_5/.vs/HWTask_5/v16/Browse.VC.db new file mode 100644 index 00000000..d09b44bc Binary files /dev/null and b/HW/HW/HWTask_5/.vs/HWTask_5/v16/Browse.VC.db differ diff --git a/HW/HW/HWTask_5/.vs/HWTask_5/v16/ipch/AutoPCH/d8bca088d0924091/MAIN.ipch b/HW/HW/HWTask_5/.vs/HWTask_5/v16/ipch/AutoPCH/d8bca088d0924091/MAIN.ipch new file mode 100644 index 00000000..f36cc713 Binary files /dev/null and b/HW/HW/HWTask_5/.vs/HWTask_5/v16/ipch/AutoPCH/d8bca088d0924091/MAIN.ipch differ diff --git a/HW/HW/HWTask_5/Debug/File_Manager_V1.exe b/HW/HW/HWTask_5/Debug/File_Manager_V1.exe new file mode 100644 index 00000000..d4d76b67 Binary files /dev/null and b/HW/HW/HWTask_5/Debug/File_Manager_V1.exe differ diff --git a/HW/HW/HWTask_5/Debug/File_Manager_V1.pdb b/HW/HW/HWTask_5/Debug/File_Manager_V1.pdb new file mode 100644 index 00000000..8fc95abd Binary files /dev/null and b/HW/HW/HWTask_5/Debug/File_Manager_V1.pdb differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.exe.recipe b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.exe.recipe new file mode 100644 index 00000000..799833af --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\HW\HW\HWTask_5\Debug\File_Manager_V1.exe + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.ilk b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.ilk new file mode 100644 index 00000000..329e38a9 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.ilk differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.log b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.log new file mode 100644 index 00000000..dbe262d2 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.log @@ -0,0 +1,14 @@ + main.c +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(469,32): warning C4133: =: несовместимые типы - из "char *" в "int *" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(471,37): warning C4133: =: несовместимые типы - из "char *" в "int *" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(480,28): warning C4133: =: несовместимые типы - из "int *" в "char *" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(486,28): warning C4133: =: несовместимые типы - из "int *" в "char *" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(495,24): warning C4133: =: несовместимые типы - из "int *" в "char *" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(503,24): warning C4133: =: несовместимые типы - из "int *" в "char *" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(461,1): warning C4133: инициализация: несовместимые типы - из "char **" в "int **" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(462,1): warning C4133: инициализация: несовместимые типы - из "char **" в "int **" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(568,9): warning C4013: gets: нет определения; предполагается "extern" с возвратом типа "int" +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(540,20): warning C4101: cur_file: неиспользованная локальная переменная +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(545,10): warning C4101: full_file_path: неиспользованная локальная переменная +C:\git\Informatics-and-Programming\HW\HW\HWTask_5\File_Manager_V1\main.c(326): warning C4715: getFileSize: значение возвращается не при всех путях выполнения + File_Manager_V1.vcxproj -> C:\git\Informatics-and-Programming\HW\HW\HWTask_5\Debug\File_Manager_V1.exe diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.command.1.tlog b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.command.1.tlog new file mode 100644 index 00000000..196ed056 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.command.1.tlog differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.read.1.tlog b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.read.1.tlog new file mode 100644 index 00000000..0f582a05 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.read.1.tlog differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.write.1.tlog b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.write.1.tlog new file mode 100644 index 00000000..34fc422c Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/CL.write.1.tlog differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/File_Manager_V1.lastbuildstate b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/File_Manager_V1.lastbuildstate new file mode 100644 index 00000000..67887331 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/File_Manager_V1.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\HW\HW\HWTask_5\| diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.command.1.tlog b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.command.1.tlog new file mode 100644 index 00000000..be4bb166 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.command.1.tlog differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.read.1.tlog b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.read.1.tlog new file mode 100644 index 00000000..f9d3cd04 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.read.1.tlog differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.write.1.tlog b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.write.1.tlog new file mode 100644 index 00000000..673b3ca8 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/File_Manager_V1.tlog/link.write.1.tlog differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/main.obj b/HW/HW/HWTask_5/File_Manager_V1/Debug/main.obj new file mode 100644 index 00000000..fcbf721d Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/main.obj differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/main.obj.enc b/HW/HW/HWTask_5/File_Manager_V1/Debug/main.obj.enc new file mode 100644 index 00000000..48a8f9c2 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/main.obj.enc differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/vc142.idb b/HW/HW/HWTask_5/File_Manager_V1/Debug/vc142.idb new file mode 100644 index 00000000..7b7c80fd Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/vc142.idb differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/Debug/vc142.pdb b/HW/HW/HWTask_5/File_Manager_V1/Debug/vc142.pdb new file mode 100644 index 00000000..f604bda8 Binary files /dev/null and b/HW/HW/HWTask_5/File_Manager_V1/Debug/vc142.pdb differ diff --git a/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj b/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj new file mode 100644 index 00000000..055b00f2 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {92f653cd-aba8-4d1d-8313-d7b4c205f7ac} + FileManagerV1 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj.filters b/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj.user b/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/File_Manager_V1.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/.gitignore b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/.gitignore new file mode 100644 index 00000000..fe165ab7 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/.gitignore @@ -0,0 +1,18 @@ +/CMakeCache.txt +/CMakeFiles +/CTestTestfile.cmake +/DartConfiguration.tcl +/Makefile +/Testing +/Win32 +/cmake_install.cmake +/find +/locate +/ls +/t-compile +/t-dirent +/updatedb +/*.filters +/*.vcxproj +/*.dir + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/CMakeLists.txt b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/CMakeLists.txt new file mode 100644 index 00000000..c2911053 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required (VERSION 2.8.11) +project (dirent LANGUAGES C CXX) + +# Initialize C and C++ compilers +enable_language (C CXX) + +# Compile in debug mode by default +if (NOT CMAKE_BUILD_TYPE) + set (CMAKE_BUILD_TYPE Debug + CACHE STRING + "Type of build: None Debug Release RelWithDebInfo MinSizeRel." + FORCE + ) +endif (NOT CMAKE_BUILD_TYPE) + +# Use the include directory only on Windows +if (WIN32) + include_directories (${CMAKE_SOURCE_DIR}/include) +endif (WIN32) + +# Install dirent.h +if (WIN32) + install (FILES include/dirent.h DESTINATION include) +else (WIN32) + cmake_policy(SET CMP0037 OLD) # Supress warnings about fake install + add_custom_target(install) # Fake install target +endif (WIN32) + +# Add distclean target +add_custom_target (distclean + COMMAND ${CMAKE_BUILD_TOOL} clean + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/distclean.cmake +) + +# Build example programs +add_executable (find examples/find.c) +add_executable (ls examples/ls.c) +add_executable (locate examples/locate.c) +add_executable (updatedb examples/updatedb.c) +add_executable (scandir examples/scandir.c) + +# Build test programs +include (CTest) +add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) +function (add_test_executable TEST_NAME) + add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN}) + add_test (NAME ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND $) + add_dependencies (check ${TEST_NAME}) +endfunction (add_test_executable) + +add_test_executable (t-compile tests/t-compile.c) +add_test_executable (t-dirent tests/t-dirent.c) +add_test_executable (t-scandir tests/t-scandir.c) +add_test_executable (t-cplusplus tests/t-cplusplus.cpp) + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/ChangeLog b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/ChangeLog new file mode 100644 index 00000000..b35153d2 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/ChangeLog @@ -0,0 +1,126 @@ +2017-08-27 Toni Rönkkö + + * Version 1.23: support readdir_r and scandir functions. + +2017-07-18 Toni Rönkkö + + * Created release branches v1.22 and v1.21 to Git. Published version + 1.22 at softagalleria.net. + +2016-09-11 Toni Rönkkö + + * Version 1.22: added support for CMake. Thanks to Paul Fultz II. + +2014-09-25 Toni Rönkkö + + * Version 1.21: compiles correctly under Open Watcom. Thanks to + Virgil Banowetz for a patch! + +2014-04-07 Toni Rönkkö + + * Version 1.20.1: the zip file from the previous version did not open + correctly with Microsoft's compressed folders. Thanks to Alexandre + for info! + +2014-03-17 Toni Ronkko + + * Version 1.20: dirent.h compiles correctly in 64-bit architecture. + Thanks to Aaron Simmons! + +2014-03-03 Toni Ronkko + + * Version 1.13.2: define DT_LNK for compatibility with Unix + programs. Thanks to Joel Bruick for suggestion! + +2013-01-27 Toni Ronkko + + * Version 1.13.1: patch from Edward Berner fixes set_errno() on + Windows NT 4.0. + + * Revised wcstombs() and mbstowcs() wrappers to make sure that they do + not write past their target string. + + * PATH_MAX from windows.h includes zero terminator so there is no + need to add one extra byte to variables and structures. + +2012-12-12 Toni Ronkko + + * Version 1.13: use the traditional 8+3 file naming scheme if a file + name cannot be represented in the default ANSI code page. Now + compiles again with MSVC 6.0. Thanks to Konstantin Khomoutov for + testing. + +2012-10-01 Toni Ronkko + + * Version 1.12.1: renamed wide-character DIR structure _wDIR to + _WDIR (with capital W) in order to maintain compatibility with MingW. + +2012-09-30 Toni Ronkko + + * Version 1.12: define PATH_MAX and NAME_MAX. Added wide-character + variants _wDIR, _wdirent, _wopendir(), _wreaddir(), _wclosedir() and + _wrewinddir(). Thanks to Edgar Buerkle and Jan Nijtmans for ideas + and code. + + * Now avoiding windows.h. This allows dirent.h to be integrated + more easily into programs using winsock. Thanks to Fernando + Azaldegui. + +2011-03-15 Toni Ronkko + + * Version 1.11: defined FILE_ATTRIBUTE_DEVICE for MSVC 6.0. + +2010-08-11 Toni Ronkko + + * Version 1.10: added d_type and d_namlen fields to dirent structure. + The former is especially useful for determining whether directory + entry represents a file or a directory. For more information, see + http://www.delorie.com/gnu/docs/glibc/libc_270.html + + * Improved conformance to the standards. For example, errno is now + set properly on failure and assert() is never used. Thanks to Peter + Brockam for suggestions. + + * Fixed a bug in rewinddir(): when using relative directory names, + change of working directory no longer causes rewinddir() to fail. + +2009-12-15 John Cunningham + + * Version 1.9: added rewinddir member function + +2008-01-18 Toni Ronkko + + * Version 1.8: Using FindFirstFileA and WIN32_FIND_DATAA to avoid + converting string between multi-byte and unicode representations. + This makes the code simpler and also allows the code to be compiled + under MingW. Thanks to Azriel Fasten for the suggestion. + +2007-03-04 Toni Ronkko + + * Bug fix: due to the strncpy_s() function this file only compiled in + Visual Studio 2005. Using the new string functions only when the + compiler version allows. + +2006-11-02 Toni Ronkko + + * Major update: removed support for Watcom C, MS-DOS and Turbo C to + simplify the file, updated the code to compile cleanly on Visual + Studio 2005 with both unicode and multi-byte character strings, + removed rewinddir() as it had a bug. + +2006-08-20 Toni Ronkko + + * Removed all remarks about MSVC 1.0, which is antiqued now. + Simplified comments by removing SGML tags. + +2002-05-14 Toni Ronkko + + * Embedded the function definitions directly to the header so that no + source modules need to be included in the Visual Studio project. + Removed all the dependencies to other projects so that this header + file can be used independently. + +1998-05-28 Toni Ronkko + + * First version. + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/LICENSE b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/LICENSE new file mode 100644 index 00000000..86a43515 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Toni Rönkkö + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/README.md b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/README.md new file mode 100644 index 00000000..8f6da0d2 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/README.md @@ -0,0 +1,93 @@ +# Dirent +Dirent is a C/C++ programming interface that allows programmers to retrieve +information about files and directories under Linux/UNIX. This project +provides Linux compatible Dirent interface for Microsoft Windows. + + +# Installation + +Download the latest Dirent installation package from +[GitHub](https://github.com/tronkko/dirent/releases) and +unpack the installation file with 7-zip, for example. The installation +package contains dirent.h file as well as a few example programs and +tests. + + +## Install Dirent for All Programs + +To make dirent.h available for all C/C++ programs, simply copy the +``include/dirent.h`` file to the system include directory. System include +directory contains header files such as assert.h and windows.h. In Visual +Studio 2008, for example, the system include may be found at +``C:\Program Files\Microsoft Visual Studio 9.0\VC\include``. + +Everything you need is included in the single dirent.h file, and you can +start using Dirent immediately -- there is no need to add files to your +Visual Studio project. + + +## Embed Dirent into Your Own Project + +If you wish to distribute dirent.h alongside with your own source code, then +copy ``include/dirent.h`` file to a new sub-directory within your project and +add that directory to include path on Windows while omitting the directory +under Linux/UNIX. This allows your project to be compiled against native +dirent.h on Linux/UNIX while substituting the functionality on Microsoft +Windows. + + +## Examples + +The installation package contains four example programs: + +Program | Purpose +-------- | ----------------------------------------------------------------- +ls | List files in a directory, e.g. ls "c:\Program Files" +find | Find files in subdirectories, e.g. find "c:\Program Files\CMake" +updatedb | Build database of files in a drive, e.g. updatedb c:\ +locate | Locate a file from database, e.g. locate notepad.exe + +To build the example programs, install [CMake](https://cmake.org/). +Then, open command prompt and create a build directory as + +``` +c:\ +mkdir temp +mkdir temp\dirent +cd temp\dirent +``` + +Generate build files as + +``` +cmake . +``` + +Open Visual Studio, load the generated dirent.sln file from the build +directory and build the solution. Once ready, you can run the example +programs from the command prompt as + +``` +cd Debug +ls . +find . +updatedb c:\ +locate cmd.exe +``` + + +# Copying + +Dirent may be freely distributed under the MIT license. See the LICENSE +file for details. + + +# Alternatives to Dirent + +I ported Dirent to Microsoft Windows in 1998 when only a few alternatives +were available. However, the situation has changed since then and nowadays +both [Cygwin](http://www.cygwin.com) and [MingW](http://www.mingw.org) +allow you to compile a great number of UNIX programs in Microsoft Windows. +They both provide a full dirent API as well as many other UNIX APIs. MingW +can even be used for commercial applications! + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/distclean.cmake b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/distclean.cmake new file mode 100644 index 00000000..4286d316 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/distclean.cmake @@ -0,0 +1,63 @@ +# Remove CMake generated temporary files +set (cmake_generated + ${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj + ${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.filters + ${CMAKE_BINARY_DIR}/CMakeCache.txt + ${CMAKE_BINARY_DIR}/CMakeFiles + ${CMAKE_BINARY_DIR}/CTestTestfile.cmake + ${CMAKE_BINARY_DIR}/Continuous.vcxproj + ${CMAKE_BINARY_DIR}/Continuous.vcxproj.filters + ${CMAKE_BINARY_DIR}/DartConfiguration.tcl + ${CMAKE_BINARY_DIR}/Debug + ${CMAKE_BINARY_DIR}/Experimental.vcxproj + ${CMAKE_BINARY_DIR}/Experimental.vcxproj.filters + ${CMAKE_BINARY_DIR}/INSTALL.vcxproj + ${CMAKE_BINARY_DIR}/INSTALL.vcxproj.filters + ${CMAKE_BINARY_DIR}/Makefile + ${CMAKE_BINARY_DIR}/Nightly.vcxproj + ${CMAKE_BINARY_DIR}/Nightly.vcxproj.filters + ${CMAKE_BINARY_DIR}/NightlyMemoryCheck.vcxproj + ${CMAKE_BINARY_DIR}/NightlyMemoryCheck.vcxproj.filters + ${CMAKE_BINARY_DIR}/RUN_TESTS.vcxproj + ${CMAKE_BINARY_DIR}/RUN_TESTS.vcxproj.filters + ${CMAKE_BINARY_DIR}/Testing + ${CMAKE_BINARY_DIR}/Win32 + ${CMAKE_BINARY_DIR}/ZERO_CHECK.vcxproj + ${CMAKE_BINARY_DIR}/ZERO_CHECK.vcxproj.filters + ${CMAKE_BINARY_DIR}/check.vcxproj + ${CMAKE_BINARY_DIR}/check.vcxproj.filters + ${CMAKE_BINARY_DIR}/cmake_install.cmake + ${CMAKE_BINARY_DIR}/dirent.sln + ${CMAKE_BINARY_DIR}/distclean.vcxproj + ${CMAKE_BINARY_DIR}/distclean.vcxproj.filters + ${CMAKE_BINARY_DIR}/find + ${CMAKE_BINARY_DIR}/find.dir + ${CMAKE_BINARY_DIR}/find.vcxproj + ${CMAKE_BINARY_DIR}/find.vcxproj.filters + ${CMAKE_BINARY_DIR}/locate + ${CMAKE_BINARY_DIR}/locate.dir + ${CMAKE_BINARY_DIR}/locate.vcxproj + ${CMAKE_BINARY_DIR}/locate.vcxproj.filters + ${CMAKE_BINARY_DIR}/ls + ${CMAKE_BINARY_DIR}/ls.dir + ${CMAKE_BINARY_DIR}/ls.vcxproj + ${CMAKE_BINARY_DIR}/ls.vcxproj.filters + ${CMAKE_BINARY_DIR}/t-compile + ${CMAKE_BINARY_DIR}/t-compile.dir + ${CMAKE_BINARY_DIR}/t-compile.vcxproj + ${CMAKE_BINARY_DIR}/t-compile.vcxproj.filters + ${CMAKE_BINARY_DIR}/t-dirent + ${CMAKE_BINARY_DIR}/t-dirent.dir + ${CMAKE_BINARY_DIR}/t-dirent.vcxproj + ${CMAKE_BINARY_DIR}/t-dirent.vcxproj.filters + ${CMAKE_BINARY_DIR}/updatedb + ${CMAKE_BINARY_DIR}/updatedb.dir + ${CMAKE_BINARY_DIR}/updatedb.vcxproj + ${CMAKE_BINARY_DIR}/updatedb.vcxproj.filters +) +foreach (file ${cmake_generated}) + if (EXISTS ${file}) + file (REMOVE_RECURSE ${file}) + endif() +endforeach (file) + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/find.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/find.c new file mode 100644 index 00000000..c2e8be2c --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/find.c @@ -0,0 +1,143 @@ +/* + * An example demonstrating recursive directory traversal. + * + * Compile this file with Visual Studio and run the produced command in + * console with a directory name argument. For example, command + * + * find "C:\Program Files" + * + * will output thousands of file names such as + * + * c:\Program Files/7-Zip/7-zip.chm + * c:\Program Files/7-Zip/7-zip.dll + * c:\Program Files/7-Zip/7z.dll + * c:\Program Files/Adobe/Reader 10.0/Reader/logsession.dll + * c:\Program Files/Adobe/Reader 10.0/Reader/LogTransport2.exe + * c:\Program Files/Windows NT/Accessories/wordpad.exe + * c:\Program Files/Windows NT/Accessories/write.wpc + * + * The find command provided by this file is only an example: the command does + * not provide options to restrict the output to certain files as the Linux + * version does. + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#include + +static int find_directory (const char *dirname); + + +int +main( + int argc, char *argv[]) +{ + int i; + int ok; + + /* For each directory in command line */ + i = 1; + while (i < argc) { + ok = find_directory (argv[i]); + if (!ok) { + exit (EXIT_FAILURE); + } + i++; + } + + /* List current working directory if no arguments on command line */ + if (argc == 1) { + find_directory ("."); + } + return EXIT_SUCCESS; +} + +/* Find files and subdirectories recursively */ +static int +find_directory( + const char *dirname) +{ + DIR *dir; + char buffer[PATH_MAX + 2]; + char *p = buffer; + const char *src; + char *end = &buffer[PATH_MAX]; + int ok; + + /* Copy directory name to buffer */ + src = dirname; + while (p < end && *src != '\0') { + *p++ = *src++; + } + *p = '\0'; + + /* Open directory stream */ + dir = opendir (dirname); + if (dir != NULL) { + struct dirent *ent; + + /* Print all files and directories within the directory */ + while ((ent = readdir (dir)) != NULL) { + char *q = p; + char c; + + /* Get final character of directory name */ + if (buffer < q) { + c = q[-1]; + } else { + c = ':'; + } + + /* Append directory separator if not already there */ + if (c != ':' && c != '/' && c != '\\') { + *q++ = '/'; + } + + /* Append file name */ + src = ent->d_name; + while (q < end && *src != '\0') { + *q++ = *src++; + } + *q = '\0'; + + /* Decide what to do with the directory entry */ + switch (ent->d_type) { + case DT_LNK: + case DT_REG: + /* Output file name with directory */ + printf ("%s\n", buffer); + break; + + case DT_DIR: + /* Scan sub-directory recursively */ + if (strcmp (ent->d_name, ".") != 0 + && strcmp (ent->d_name, "..") != 0) { + find_directory (buffer); + } + break; + + default: + /* Ignore device entries */ + /*NOP*/; + } + + } + + closedir (dir); + ok = 1; + + } else { + /* Could not open directory */ + printf ("Cannot open directory %s\n", dirname); + ok = 0; + } + + return ok; +} + + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/locate.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/locate.c new file mode 100644 index 00000000..5179461a --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/locate.c @@ -0,0 +1,281 @@ +/* + * A file look-up utility to complement updatedb + * + * Compile and run updatedb command first to create locate.db file. Then, + * compile this program with Visual Studio and run the program in console with + * a file name argument. For example, the command + * + * locate autoexec + * + * might output something like + * + * c:/AUTOEXEC.BAT + * c:/WINDOWS/repair/autoexec.nt + * c:/WINDOWS/system32/AUTOEXEC.NT + * + * Be ware that this file uses wide-character API which is not compatible + * with Linux or other major Unixes. + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#include +#ifdef WIN32 +# include +# include +#endif +#include + +/* File name and location of database file */ +#define DB_LOCATION L"locate.db" + + +/* Forward-decl */ +static int db_locate (const wchar_t *pattern); +static int db_match (const wchar_t *fn, const wchar_t *pattern); +static void db_open (void); +static void db_close (void); +static int db_read (wchar_t *buffer, size_t max); + + +/* Module local variables */ +static FILE *db = NULL; + + +int +main( + int argc, char *argv[]) +{ +#ifdef WIN32 + int i; + + /* Prepare for unicode output */ + _setmode (_fileno (stdout), _O_U16TEXT); + + /* For each pattern in command line */ + i = 1; + while (i < argc) { + wchar_t buffer[PATH_MAX + 1]; + errno_t error; + size_t n; + int count = 0; + + /* Convert ith argument to wide-character string */ + error = mbstowcs_s (&n, buffer, PATH_MAX, argv[i], _TRUNCATE); + if (!error) { + /* Find files matching pattern */ + count = db_locate (buffer); + + /* Output warnign if string is not found */ + if (count == 0) { + wprintf (L"%s not found\n", buffer); + } + } + + + i++; + } + + if (argc < 2) { + wprintf (L"Usage: locate pattern\n"); + exit (EXIT_FAILURE); + } +#else + printf ("locate only works on Microsoft Windows\n"); +#endif + + return EXIT_SUCCESS; +} + +/* Match pattern against files in locate.db file */ +static int +db_locate( + const wchar_t *pattern) +{ + int count = 0; + +#ifdef WIN32 + wchar_t buffer[PATH_MAX + 1]; + + /* Open locate.db for read */ + db_open (); + + /* Read one directory and file name at a time from database file */ + while (db_read (buffer, PATH_MAX)) { + /* See if file name in buffer matches the search pattern */ + if (db_match (buffer, pattern)) { + /* Match found => output file name and path */ + wprintf (L"%s\n", buffer); + count++; + } + + } + + db_close (); +#endif + + return count; +} + +/* Match pattern against file name */ +static int +db_match( + const wchar_t *fn, const wchar_t *pattern) +{ + int found = 0; + +#ifdef WIN32 + wchar_t *p; + wchar_t base[PATH_MAX + 1]; + wchar_t patt[PATH_MAX + 1]; + int i; + int done = 0; + + /* Locate zero-terminator from fn */ + p = wcschr (fn, '\0'); + + /* Find base name from buffer */ + while (fn < p && !done) { + switch (p[-1]) { + case ':': + case '/': + case '\\': + /* Final path separator found */ + done = 1; + break; + + default: + /* No path separator yet */ + p--; + } + } + + /* Convert base name to lower case */ + i = 0; + while (i < PATH_MAX && p[i] != '\0') { + base[i] = towlower (p[i]); + i++; + } + base[i] = '\0'; + + /* Convert search pattern to lower case */ + i = 0; + while (i < PATH_MAX && pattern[i] != '\0') { + patt[i] = towlower (pattern[i]); + i++; + } + patt[i] = '\0'; + + /* See if file name matches pattern */ + if (wcsstr (base, patt) != NULL) { + found = 1; + } else { + found = 0; + } +#endif + + return found; +} + +/* + * Read line from locate.db. This function is same as fgetws() except + * that new-line at the end of line is not included. + */ +static int +db_read( + wchar_t *buffer, size_t max) +{ + int ok = 0; + +#ifdef WIN32 + size_t i = 0; + wchar_t c; + int done = 0; + + do { + /* Read wide-character from stream */ + if (db) { + c = fgetwc (db); + } else { + wprintf (L"Database not open\n"); + exit (EXIT_SUCCESS); + } + + /* Determine how to process character */ + switch (c) { + case '\r': + /* Ignore, should be handled by run-time libraries */ + /*NOP*/; + break; + + case '\n': + /* End of string => return file name and true */ + done = 1; + ok = 1; + break; + + case /*EOF*/WEOF: + /* End of file */ + done = 1; + if (i == 0) { + /* No data in buffer => return false to indicate EOF */ + ok = 0; + } else { + /* Data in buffer => return true */ + ok = 1; + } + break; + + default: + /* Store character */ + if (i < max - 1) { + buffer[i++] = c; + } else { + wprintf (L"Buffer too small"); + exit (EXIT_FAILURE); + } + } + } while (!done); + + /* Zero-terminate buffer */ + buffer[i] = '\0'; +#endif + + return ok; +} + +/* Open database file locate.db */ +static void +db_open( + void) +{ +#ifdef WIN32 + if (db == NULL) { + errno_t error; + + /* Open file for writing */ + error = _wfopen_s (&db, DB_LOCATION, L"rt, ccs=UNICODE"); + if (error) { + wprintf (L"Cannot open %s\n", DB_LOCATION); + exit (EXIT_FAILURE); + } + } +#endif +} + +/* Close database file */ +static void +db_close( + void) +{ + if (db) { + fclose (db); + db = NULL; + } +} + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/ls.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/ls.c new file mode 100644 index 00000000..e255c23d --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/ls.c @@ -0,0 +1,98 @@ +/* + * An example demonstrating basic directory listing. + * + * Compile this file with Visual Studio and run the produced command in + * console with a directory name argument. For example, command + * + * ls "c:\Program Files" + * + * might output something like + * + * ./ + * ../ + * 7-Zip/ + * Internet Explorer/ + * Microsoft Visual Studio 9.0/ + * Microsoft.NET/ + * Mozilla Firefox/ + * + * The ls command provided by this file is only an example: the command does + * not have any fancy options like "ls -al" in Linux and the command does not + * support file name matching like "ls *.c". + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#include + +static void list_directory (const char *dirname); + + +int +main( + int argc, char *argv[]) +{ + int i; + + /* For each directory in command line */ + i = 1; + while (i < argc) { + list_directory (argv[i]); + i++; + } + + /* List current working directory if no arguments on command line */ + if (argc == 1) { + list_directory ("."); + } + return EXIT_SUCCESS; +} + +/* + * List files and directories within a directory. + */ +static void +list_directory( + const char *dirname) +{ + DIR *dir; + struct dirent *ent; + + /* Open directory stream */ + dir = opendir (dirname); + if (dir != NULL) { + + /* Print all files and directories within the directory */ + while ((ent = readdir (dir)) != NULL) { + switch (ent->d_type) { + case DT_REG: + printf ("%s\n", ent->d_name); + break; + + case DT_DIR: + printf ("%s/\n", ent->d_name); + break; + + case DT_LNK: + printf ("%s@\n", ent->d_name); + break; + + default: + printf ("%s*\n", ent->d_name); + } + } + + closedir (dir); + + } else { + /* Could not open directory */ + printf ("Cannot open directory %s\n", dirname); + exit (EXIT_FAILURE); + } +} + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/scandir.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/scandir.c new file mode 100644 index 00000000..7ea9b0d2 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/scandir.c @@ -0,0 +1,105 @@ +/* + * Example program demonstrating the use of scandir function. + * + * Compile this file with Visual Studio and run the produced command in + * console with a directory name argument. For example, command + * + * scandir "c:\Program Files" + * + * might output something like + * + * ./ + * ../ + * 7-Zip/ + * Internet Explorer/ + * Microsoft Visual Studio 9.0/ + * Microsoft.NET/ + * Mozilla Firefox/ + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#include + +static void list_directory (const char *dirname); + + +int +main( + int argc, char *argv[]) +{ + int i; + + /* For each directory in command line */ + i = 1; + while (i < argc) { + list_directory (argv[i]); + i++; + } + + /* List current working directory if no arguments on command line */ + if (argc == 1) { + list_directory ("."); + } + return EXIT_SUCCESS; +} + +/* + * List files and directories within a directory. + */ +static void +list_directory( + const char *dirname) +{ + struct dirent **files; + int i; + int n; + + /* Scan files in directory */ + n = scandir (dirname, &files, NULL, alphasort); + if (n >= 0) { + + /* Loop through file names */ + for (i = 0; i < n; i++) { + struct dirent *ent; + + /* Get pointer to file entry */ + ent = files[i]; + + /* Output file name */ + switch (ent->d_type) { + case DT_REG: + printf ("%s\n", ent->d_name); + break; + + case DT_DIR: + printf ("%s/\n", ent->d_name); + break; + + case DT_LNK: + printf ("%s@\n", ent->d_name); + break; + + default: + printf ("%s*\n", ent->d_name); + } + + } + + /* Release file names */ + for (i = 0; i < n; i++) { + free (files[i]); + } + free (files); + + } else { + printf ("Cannot open directory %s\n", dirname); + } +} + + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/updatedb.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/updatedb.c new file mode 100644 index 00000000..ff0d4fda --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/examples/updatedb.c @@ -0,0 +1,233 @@ +/* + * An example demonstrating wide-character functions + * + * Compile this file with Visual Studio and run the produced command in + * console with a directory name argument. For example, command + * + * updatedb C:\ + * + * will produce the file locate.db with one file name per line such as + * + * c:\Program Files/7-Zip/7-zip.chm + * c:\Program Files/7-Zip/7-zip.dll + * c:\Program Files/7-Zip/7z.dll + * c:\Program Files/Adobe/Reader 10.0/Reader/logsession.dll + * c:\Program Files/Adobe/Reader 10.0/Reader/LogTransport2.exe + * c:\Program Files/Windows NT/Accessories/wordpad.exe + * c:\Program Files/Windows NT/Accessories/write.wpc + * + * Be ware that this file uses wide-character API which is not compatible + * with Linux or other major Unixes. + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#include +#ifdef WIN32 +# include +# include +#endif +#include + +/* File name and location of database file */ +#define DB_LOCATION L"locate.db" + + +/* Forward-decl */ +static int update_directory (const wchar_t *dirname); +static void db_open (void); +static void db_close (void); +static void db_store (const wchar_t *dirname); + + +/* Module local variables */ +static FILE *db = NULL; + + +int +main( + int argc, char *argv[]) +{ +#ifdef WIN32 + int i; + int ok; + + /* Prepare for unicode output */ + _setmode (_fileno (stdout), _O_U16TEXT); + + /* Open locate.db */ + db_open (); + + /* For each directory in command line */ + i = 1; + while (i < argc) { + wchar_t buffer[PATH_MAX + 1]; + errno_t error; + size_t n; + + /* Convert ith argument to wide-character string */ + error = mbstowcs_s (&n, buffer, PATH_MAX, argv[i], _TRUNCATE); + if (!error) { + + /* Scan directory for files */ + ok = update_directory (buffer); + if (!ok) { + wprintf (L"Cannot open directory %s\n", buffer); + exit (EXIT_FAILURE); + } + + } + + i++; + } + + /* Use current working directory if no arguments on command line */ + if (argc == 1) { + update_directory (L"."); + } + + db_close (); +#else + printf ("updatedb only works on Microsoft Windows\n"); +#endif + + return EXIT_SUCCESS; +} + +/* Find files recursively */ +static int +update_directory( + const wchar_t *dirname) +{ + int ok = 0; + +#ifdef WIN32 + _WDIR *dir; + wchar_t buffer[PATH_MAX + 2]; + wchar_t *p = buffer; + const wchar_t *src; + wchar_t *end = &buffer[PATH_MAX]; + + /* Copy directory name to buffer */ + src = dirname; + while (p < end && *src != '\0') { + *p++ = *src++; + } + *p = '\0'; + + /* Open directory stream */ + dir = _wopendir (dirname); + if (dir != NULL) { + struct _wdirent *ent; + + /* Print all files and directories within the directory */ + while ((ent = _wreaddir (dir)) != NULL) { + wchar_t *q = p; + wchar_t c; + + /* Get final character of directory name */ + if (buffer < q) { + c = q[-1]; + } else { + c = ':'; + } + + /* Append directory separator if not already there */ + if (c != ':' && c != '/' && c != '\\') { + *q++ = '/'; + } + + /* Append file name */ + src = ent->d_name; + while (q < end && *src != '\0') { + *q++ = *src++; + } + *q = '\0'; + + /* Decide what to do with the directory entry */ + switch (ent->d_type) { + case DT_REG: + /* Store file name */ + db_store (buffer); + break; + + case DT_DIR: + /* Scan sub-directory recursively */ + if (wcscmp (ent->d_name, L".") != 0 + && wcscmp (ent->d_name, L"..") != 0) { + update_directory (buffer); + } + break; + + default: + /* Do not device entries */ + /*NOP*/; + } + + } + + wclosedir (dir); + ok = 1; + + } else { + + /* Cannot open directory */ + ok = 0; + + } +#endif + + return ok; +} + +/* Store file name to locate.db */ +static void +db_store( + const wchar_t *dirname) +{ +#ifdef WIN32 + if (db) { + /* Output line to file */ + fwprintf (db, L"%s\n", dirname); + } else { + wprintf (L"Database not open\n"); + exit (EXIT_FAILURE); + } +#endif +} + +/* Open database file locate.db */ +static void +db_open( + void) +{ +#ifdef WIN32 + if (db == NULL) { + errno_t error; + + /* Open file for writing */ + error = _wfopen_s (&db, DB_LOCATION, L"wt, ccs=UNICODE"); + if (error) { + wprintf (L"Cannot open %s\n", DB_LOCATION); + exit (EXIT_FAILURE); + } + } +#endif +} + +/* Close database file */ +static void +db_close( + void) +{ + if (db) { + fclose (db); + db = NULL; + } +} + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/include/dirent.h b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/include/dirent.h new file mode 100644 index 00000000..332c798a --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/include/dirent.h @@ -0,0 +1,1160 @@ +/* + * Dirent interface for Microsoft Visual Studio + * Version 1.23.1 + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#ifndef DIRENT_H +#define DIRENT_H + +/* + * Include windows.h without Windows Sockets 1.1 to prevent conflicts with + * Windows Sockets 2.0. + */ +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Indicates that d_type field is available in dirent structure */ +#define _DIRENT_HAVE_D_TYPE + +/* Indicates that d_namlen field is available in dirent structure */ +#define _DIRENT_HAVE_D_NAMLEN + +/* Entries missing from MSVC 6.0 */ +#if !defined(FILE_ATTRIBUTE_DEVICE) +# define FILE_ATTRIBUTE_DEVICE 0x40 +#endif + +/* File type and permission flags for stat(), general mask */ +#if !defined(S_IFMT) +# define S_IFMT _S_IFMT +#endif + +/* Directory bit */ +#if !defined(S_IFDIR) +# define S_IFDIR _S_IFDIR +#endif + +/* Character device bit */ +#if !defined(S_IFCHR) +# define S_IFCHR _S_IFCHR +#endif + +/* Pipe bit */ +#if !defined(S_IFFIFO) +# define S_IFFIFO _S_IFFIFO +#endif + +/* Regular file bit */ +#if !defined(S_IFREG) +# define S_IFREG _S_IFREG +#endif + +/* Read permission */ +#if !defined(S_IREAD) +# define S_IREAD _S_IREAD +#endif + +/* Write permission */ +#if !defined(S_IWRITE) +# define S_IWRITE _S_IWRITE +#endif + +/* Execute permission */ +#if !defined(S_IEXEC) +# define S_IEXEC _S_IEXEC +#endif + +/* Pipe */ +#if !defined(S_IFIFO) +# define S_IFIFO _S_IFIFO +#endif + +/* Block device */ +#if !defined(S_IFBLK) +# define S_IFBLK 0 +#endif + +/* Link */ +#if !defined(S_IFLNK) +# define S_IFLNK 0 +#endif + +/* Socket */ +#if !defined(S_IFSOCK) +# define S_IFSOCK 0 +#endif + +/* Read user permission */ +#if !defined(S_IRUSR) +# define S_IRUSR S_IREAD +#endif + +/* Write user permission */ +#if !defined(S_IWUSR) +# define S_IWUSR S_IWRITE +#endif + +/* Execute user permission */ +#if !defined(S_IXUSR) +# define S_IXUSR 0 +#endif + +/* Read group permission */ +#if !defined(S_IRGRP) +# define S_IRGRP 0 +#endif + +/* Write group permission */ +#if !defined(S_IWGRP) +# define S_IWGRP 0 +#endif + +/* Execute group permission */ +#if !defined(S_IXGRP) +# define S_IXGRP 0 +#endif + +/* Read others permission */ +#if !defined(S_IROTH) +# define S_IROTH 0 +#endif + +/* Write others permission */ +#if !defined(S_IWOTH) +# define S_IWOTH 0 +#endif + +/* Execute others permission */ +#if !defined(S_IXOTH) +# define S_IXOTH 0 +#endif + +/* Maximum length of file name */ +#if !defined(PATH_MAX) +# define PATH_MAX MAX_PATH +#endif +#if !defined(FILENAME_MAX) +# define FILENAME_MAX MAX_PATH +#endif +#if !defined(NAME_MAX) +# define NAME_MAX FILENAME_MAX +#endif + +/* File type flags for d_type */ +#define DT_UNKNOWN 0 +#define DT_REG S_IFREG +#define DT_DIR S_IFDIR +#define DT_FIFO S_IFIFO +#define DT_SOCK S_IFSOCK +#define DT_CHR S_IFCHR +#define DT_BLK S_IFBLK +#define DT_LNK S_IFLNK + +/* Macros for converting between st_mode and d_type */ +#define IFTODT(mode) ((mode) & S_IFMT) +#define DTTOIF(type) (type) + +/* + * File type macros. Note that block devices, sockets and links cannot be + * distinguished on Windows and the macros S_ISBLK, S_ISSOCK and S_ISLNK are + * only defined for compatibility. These macros should always return false + * on Windows. + */ +#if !defined(S_ISFIFO) +# define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) +#endif +#if !defined(S_ISDIR) +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#endif +#if !defined(S_ISREG) +# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) +#endif +#if !defined(S_ISLNK) +# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) +#endif +#if !defined(S_ISSOCK) +# define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) +#endif +#if !defined(S_ISCHR) +# define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR) +#endif +#if !defined(S_ISBLK) +# define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) +#endif + +/* Return the exact length of the file name without zero terminator */ +#define _D_EXACT_NAMLEN(p) ((p)->d_namlen) + +/* Return the maximum size of a file name */ +#define _D_ALLOC_NAMLEN(p) ((PATH_MAX)+1) + + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Wide-character version */ +struct _wdirent { + /* Always zero */ + long d_ino; + + /* File position within stream */ + long d_off; + + /* Structure size */ + unsigned short d_reclen; + + /* Length of name without \0 */ + size_t d_namlen; + + /* File type */ + int d_type; + + /* File name */ + wchar_t d_name[PATH_MAX+1]; +}; +typedef struct _wdirent _wdirent; + +struct _WDIR { + /* Current directory entry */ + struct _wdirent ent; + + /* Private file data */ + WIN32_FIND_DATAW data; + + /* True if data is valid */ + int cached; + + /* Win32 search handle */ + HANDLE handle; + + /* Initial directory name */ + wchar_t *patt; +}; +typedef struct _WDIR _WDIR; + +/* Multi-byte character version */ +struct dirent { + /* Always zero */ + long d_ino; + + /* File position within stream */ + long d_off; + + /* Structure size */ + unsigned short d_reclen; + + /* Length of name without \0 */ + size_t d_namlen; + + /* File type */ + int d_type; + + /* File name */ + char d_name[PATH_MAX+1]; +}; +typedef struct dirent dirent; + +struct DIR { + struct dirent ent; + struct _WDIR *wdirp; +}; +typedef struct DIR DIR; + + +/* Dirent functions */ +static DIR *opendir (const char *dirname); +static _WDIR *_wopendir (const wchar_t *dirname); + +static struct dirent *readdir (DIR *dirp); +static struct _wdirent *_wreaddir (_WDIR *dirp); + +static int readdir_r( + DIR *dirp, struct dirent *entry, struct dirent **result); +static int _wreaddir_r( + _WDIR *dirp, struct _wdirent *entry, struct _wdirent **result); + +static int closedir (DIR *dirp); +static int _wclosedir (_WDIR *dirp); + +static void rewinddir (DIR* dirp); +static void _wrewinddir (_WDIR* dirp); + +static int scandir (const char *dirname, struct dirent ***namelist, + int (*filter)(const struct dirent*), + int (*compare)(const struct dirent**, const struct dirent**)); + +static int alphasort (const struct dirent **a, const struct dirent **b); + +static int versionsort (const struct dirent **a, const struct dirent **b); + + +/* For compatibility with Symbian */ +#define wdirent _wdirent +#define WDIR _WDIR +#define wopendir _wopendir +#define wreaddir _wreaddir +#define wclosedir _wclosedir +#define wrewinddir _wrewinddir + + +/* Internal utility functions */ +static WIN32_FIND_DATAW *dirent_first (_WDIR *dirp); +static WIN32_FIND_DATAW *dirent_next (_WDIR *dirp); + +static int dirent_mbstowcs_s( + size_t *pReturnValue, + wchar_t *wcstr, + size_t sizeInWords, + const char *mbstr, + size_t count); + +static int dirent_wcstombs_s( + size_t *pReturnValue, + char *mbstr, + size_t sizeInBytes, + const wchar_t *wcstr, + size_t count); + +static void dirent_set_errno (int error); + + +/* + * Open directory stream DIRNAME for read and return a pointer to the + * internal working area that is used to retrieve individual directory + * entries. + */ +static _WDIR* +_wopendir( + const wchar_t *dirname) +{ + _WDIR *dirp = NULL; + int error; + + /* Must have directory name */ + if (dirname == NULL || dirname[0] == '\0') { + dirent_set_errno (ENOENT); + return NULL; + } + + /* Allocate new _WDIR structure */ + dirp = (_WDIR*) malloc (sizeof (struct _WDIR)); + if (dirp != NULL) { + DWORD n; + + /* Reset _WDIR structure */ + dirp->handle = INVALID_HANDLE_VALUE; + dirp->patt = NULL; + dirp->cached = 0; + + /* Compute the length of full path plus zero terminator + * + * Note that on WinRT there's no way to convert relative paths + * into absolute paths, so just assume it is an absolute path. + */ +# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + n = wcslen(dirname); +# else + n = GetFullPathNameW (dirname, 0, NULL, NULL); +# endif + + /* Allocate room for absolute directory name and search pattern */ + dirp->patt = (wchar_t*) malloc (sizeof (wchar_t) * n + 16); + if (dirp->patt) { + + /* + * Convert relative directory name to an absolute one. This + * allows rewinddir() to function correctly even when current + * working directory is changed between opendir() and rewinddir(). + * + * Note that on WinRT there's no way to convert relative paths + * into absolute paths, so just assume it is an absolute path. + */ +# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) + wcsncpy_s(dirp->patt, n+1, dirname, n); +# else + n = GetFullPathNameW (dirname, n, dirp->patt, NULL); +# endif + if (n > 0) { + wchar_t *p; + + /* Append search pattern \* to the directory name */ + p = dirp->patt + n; + if (dirp->patt < p) { + switch (p[-1]) { + case '\\': + case '/': + case ':': + /* Directory ends in path separator, e.g. c:\temp\ */ + /*NOP*/; + break; + + default: + /* Directory name doesn't end in path separator */ + *p++ = '\\'; + } + } + *p++ = '*'; + *p = '\0'; + + /* Open directory stream and retrieve the first entry */ + if (dirent_first (dirp)) { + /* Directory stream opened successfully */ + error = 0; + } else { + /* Cannot retrieve first entry */ + error = 1; + dirent_set_errno (ENOENT); + } + + } else { + /* Cannot retrieve full path name */ + dirent_set_errno (ENOENT); + error = 1; + } + + } else { + /* Cannot allocate memory for search pattern */ + error = 1; + } + + } else { + /* Cannot allocate _WDIR structure */ + error = 1; + } + + /* Clean up in case of error */ + if (error && dirp) { + _wclosedir (dirp); + dirp = NULL; + } + + return dirp; +} + +/* + * Read next directory entry. + * + * Returns pointer to static directory entry which may be overwritten by + * subsequent calls to _wreaddir(). + */ +static struct _wdirent* +_wreaddir( + _WDIR *dirp) +{ + struct _wdirent *entry; + + /* + * Read directory entry to buffer. We can safely ignore the return value + * as entry will be set to NULL in case of error. + */ + (void) _wreaddir_r (dirp, &dirp->ent, &entry); + + /* Return pointer to statically allocated directory entry */ + return entry; +} + +/* + * Read next directory entry. + * + * Returns zero on success. If end of directory stream is reached, then sets + * result to NULL and returns zero. + */ +static int +_wreaddir_r( + _WDIR *dirp, + struct _wdirent *entry, + struct _wdirent **result) +{ + WIN32_FIND_DATAW *datap; + + /* Read next directory entry */ + datap = dirent_next (dirp); + if (datap) { + size_t n; + DWORD attr; + + /* + * Copy file name as wide-character string. If the file name is too + * long to fit in to the destination buffer, then truncate file name + * to PATH_MAX characters and zero-terminate the buffer. + */ + n = 0; + while (n < PATH_MAX && datap->cFileName[n] != 0) { + entry->d_name[n] = datap->cFileName[n]; + n++; + } + entry->d_name[n] = 0; + + /* Length of file name excluding zero terminator */ + entry->d_namlen = n; + + /* File type */ + attr = datap->dwFileAttributes; + if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) { + entry->d_type = DT_CHR; + } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) { + entry->d_type = DT_DIR; + } else { + entry->d_type = DT_REG; + } + + /* Reset dummy fields */ + entry->d_ino = 0; + entry->d_off = 0; + entry->d_reclen = sizeof (struct _wdirent); + + /* Set result address */ + *result = entry; + + } else { + + /* Return NULL to indicate end of directory */ + *result = NULL; + + } + + return /*OK*/0; +} + +/* + * Close directory stream opened by opendir() function. This invalidates the + * DIR structure as well as any directory entry read previously by + * _wreaddir(). + */ +static int +_wclosedir( + _WDIR *dirp) +{ + int ok; + if (dirp) { + + /* Release search handle */ + if (dirp->handle != INVALID_HANDLE_VALUE) { + FindClose (dirp->handle); + dirp->handle = INVALID_HANDLE_VALUE; + } + + /* Release search pattern */ + if (dirp->patt) { + free (dirp->patt); + dirp->patt = NULL; + } + + /* Release directory structure */ + free (dirp); + ok = /*success*/0; + + } else { + + /* Invalid directory stream */ + dirent_set_errno (EBADF); + ok = /*failure*/-1; + + } + return ok; +} + +/* + * Rewind directory stream such that _wreaddir() returns the very first + * file name again. + */ +static void +_wrewinddir( + _WDIR* dirp) +{ + if (dirp) { + /* Release existing search handle */ + if (dirp->handle != INVALID_HANDLE_VALUE) { + FindClose (dirp->handle); + } + + /* Open new search handle */ + dirent_first (dirp); + } +} + +/* Get first directory entry (internal) */ +static WIN32_FIND_DATAW* +dirent_first( + _WDIR *dirp) +{ + WIN32_FIND_DATAW *datap; + + /* Open directory and retrieve the first entry */ + dirp->handle = FindFirstFileExW( + dirp->patt, FindExInfoStandard, &dirp->data, + FindExSearchNameMatch, NULL, 0); + if (dirp->handle != INVALID_HANDLE_VALUE) { + + /* a directory entry is now waiting in memory */ + datap = &dirp->data; + dirp->cached = 1; + + } else { + + /* Failed to re-open directory: no directory entry in memory */ + dirp->cached = 0; + datap = NULL; + + } + return datap; +} + +/* + * Get next directory entry (internal). + * + * Returns + */ +static WIN32_FIND_DATAW* +dirent_next( + _WDIR *dirp) +{ + WIN32_FIND_DATAW *p; + + /* Get next directory entry */ + if (dirp->cached != 0) { + + /* A valid directory entry already in memory */ + p = &dirp->data; + dirp->cached = 0; + + } else if (dirp->handle != INVALID_HANDLE_VALUE) { + + /* Get the next directory entry from stream */ + if (FindNextFileW (dirp->handle, &dirp->data) != FALSE) { + /* Got a file */ + p = &dirp->data; + } else { + /* The very last entry has been processed or an error occurred */ + FindClose (dirp->handle); + dirp->handle = INVALID_HANDLE_VALUE; + p = NULL; + } + + } else { + + /* End of directory stream reached */ + p = NULL; + + } + + return p; +} + +/* + * Open directory stream using plain old C-string. + */ +static DIR* +opendir( + const char *dirname) +{ + struct DIR *dirp; + int error; + + /* Must have directory name */ + if (dirname == NULL || dirname[0] == '\0') { + dirent_set_errno (ENOENT); + return NULL; + } + + /* Allocate memory for DIR structure */ + dirp = (DIR*) malloc (sizeof (struct DIR)); + if (dirp) { + wchar_t wname[PATH_MAX + 1]; + size_t n; + + /* Convert directory name to wide-character string */ + error = dirent_mbstowcs_s( + &n, wname, PATH_MAX + 1, dirname, PATH_MAX + 1); + if (!error) { + + /* Open directory stream using wide-character name */ + dirp->wdirp = _wopendir (wname); + if (dirp->wdirp) { + /* Directory stream opened */ + error = 0; + } else { + /* Failed to open directory stream */ + error = 1; + } + + } else { + /* + * Cannot convert file name to wide-character string. This + * occurs if the string contains invalid multi-byte sequences or + * the output buffer is too small to contain the resulting + * string. + */ + error = 1; + } + + } else { + /* Cannot allocate DIR structure */ + error = 1; + } + + /* Clean up in case of error */ + if (error && dirp) { + free (dirp); + dirp = NULL; + } + + return dirp; +} + +/* + * Read next directory entry. + */ +static struct dirent* +readdir( + DIR *dirp) +{ + struct dirent *entry; + + /* + * Read directory entry to buffer. We can safely ignore the return value + * as entry will be set to NULL in case of error. + */ + (void) readdir_r (dirp, &dirp->ent, &entry); + + /* Return pointer to statically allocated directory entry */ + return entry; +} + +/* + * Read next directory entry into called-allocated buffer. + * + * Returns zero on success. If the end of directory stream is reached, then + * sets result to NULL and returns zero. + */ +static int +readdir_r( + DIR *dirp, + struct dirent *entry, + struct dirent **result) +{ + WIN32_FIND_DATAW *datap; + + /* Read next directory entry */ + datap = dirent_next (dirp->wdirp); + if (datap) { + size_t n; + int error; + + /* Attempt to convert file name to multi-byte string */ + error = dirent_wcstombs_s( + &n, entry->d_name, PATH_MAX + 1, datap->cFileName, PATH_MAX + 1); + + /* + * If the file name cannot be represented by a multi-byte string, + * then attempt to use old 8+3 file name. This allows traditional + * Unix-code to access some file names despite of unicode + * characters, although file names may seem unfamiliar to the user. + * + * Be ware that the code below cannot come up with a short file + * name unless the file system provides one. At least + * VirtualBox shared folders fail to do this. + */ + if (error && datap->cAlternateFileName[0] != '\0') { + error = dirent_wcstombs_s( + &n, entry->d_name, PATH_MAX + 1, + datap->cAlternateFileName, PATH_MAX + 1); + } + + if (!error) { + DWORD attr; + + /* Length of file name excluding zero terminator */ + entry->d_namlen = n - 1; + + /* File attributes */ + attr = datap->dwFileAttributes; + if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) { + entry->d_type = DT_CHR; + } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) { + entry->d_type = DT_DIR; + } else { + entry->d_type = DT_REG; + } + + /* Reset dummy fields */ + entry->d_ino = 0; + entry->d_off = 0; + entry->d_reclen = sizeof (struct dirent); + + } else { + + /* + * Cannot convert file name to multi-byte string so construct + * an erroneous directory entry and return that. Note that + * we cannot return NULL as that would stop the processing + * of directory entries completely. + */ + entry->d_name[0] = '?'; + entry->d_name[1] = '\0'; + entry->d_namlen = 1; + entry->d_type = DT_UNKNOWN; + entry->d_ino = 0; + entry->d_off = -1; + entry->d_reclen = 0; + + } + + /* Return pointer to directory entry */ + *result = entry; + + } else { + + /* No more directory entries */ + *result = NULL; + + } + + return /*OK*/0; +} + +/* + * Close directory stream. + */ +static int +closedir( + DIR *dirp) +{ + int ok; + if (dirp) { + + /* Close wide-character directory stream */ + ok = _wclosedir (dirp->wdirp); + dirp->wdirp = NULL; + + /* Release multi-byte character version */ + free (dirp); + + } else { + + /* Invalid directory stream */ + dirent_set_errno (EBADF); + ok = /*failure*/-1; + + } + return ok; +} + +/* + * Rewind directory stream to beginning. + */ +static void +rewinddir( + DIR* dirp) +{ + /* Rewind wide-character string directory stream */ + _wrewinddir (dirp->wdirp); +} + +/* + * Scan directory for entries. + */ +static int +scandir( + const char *dirname, + struct dirent ***namelist, + int (*filter)(const struct dirent*), + int (*compare)(const struct dirent**, const struct dirent**)) +{ + struct dirent **files = NULL; + size_t size = 0; + size_t allocated = 0; + const size_t init_size = 1; + DIR *dir = NULL; + struct dirent *entry; + struct dirent *tmp = NULL; + size_t i; + int result = 0; + + /* Open directory stream */ + dir = opendir (dirname); + if (dir) { + + /* Read directory entries to memory */ + while (1) { + + /* Enlarge pointer table to make room for another pointer */ + if (size >= allocated) { + void *p; + size_t num_entries; + + /* Compute number of entries in the enlarged pointer table */ + if (size < init_size) { + /* Allocate initial pointer table */ + num_entries = init_size; + } else { + /* Double the size */ + num_entries = size * 2; + } + + /* Allocate first pointer table or enlarge existing table */ + p = realloc (files, sizeof (void*) * num_entries); + if (p != NULL) { + /* Got the memory */ + files = (dirent**) p; + allocated = num_entries; + } else { + /* Out of memory */ + result = -1; + break; + } + + } + + /* Allocate room for temporary directory entry */ + if (tmp == NULL) { + tmp = (struct dirent*) malloc (sizeof (struct dirent)); + if (tmp == NULL) { + /* Cannot allocate temporary directory entry */ + result = -1; + break; + } + } + + /* Read directory entry to temporary area */ + if (readdir_r (dir, tmp, &entry) == /*OK*/0) { + + /* Did we get an entry? */ + if (entry != NULL) { + int pass; + + /* Determine whether to include the entry in result */ + if (filter) { + /* Let the filter function decide */ + pass = filter (tmp); + } else { + /* No filter function, include everything */ + pass = 1; + } + + if (pass) { + /* Store the temporary entry to pointer table */ + files[size++] = tmp; + tmp = NULL; + + /* Keep up with the number of files */ + result++; + } + + } else { + + /* + * End of directory stream reached => sort entries and + * exit. + */ + qsort (files, size, sizeof (void*), + (int (*) (const void*, const void*)) compare); + break; + + } + + } else { + /* Error reading directory entry */ + result = /*Error*/ -1; + break; + } + + } + + } else { + /* Cannot open directory */ + result = /*Error*/ -1; + } + + /* Release temporary directory entry */ + if (tmp) { + free (tmp); + } + + /* Release allocated memory on error */ + if (result < 0) { + for (i = 0; i < size; i++) { + free (files[i]); + } + free (files); + files = NULL; + } + + /* Close directory stream */ + if (dir) { + closedir (dir); + } + + /* Pass pointer table to caller */ + if (namelist) { + *namelist = files; + } + return result; +} + +/* Alphabetical sorting */ +static int +alphasort( + const struct dirent **a, const struct dirent **b) +{ + return strcoll ((*a)->d_name, (*b)->d_name); +} + +/* Sort versions */ +static int +versionsort( + const struct dirent **a, const struct dirent **b) +{ + /* FIXME: implement strverscmp and use that */ + return alphasort (a, b); +} + + +/* Convert multi-byte string to wide character string */ +static int +dirent_mbstowcs_s( + size_t *pReturnValue, + wchar_t *wcstr, + size_t sizeInWords, + const char *mbstr, + size_t count) +{ + int error; + +#if defined(_MSC_VER) && _MSC_VER >= 1400 + + /* Microsoft Visual Studio 2005 or later */ + error = mbstowcs_s (pReturnValue, wcstr, sizeInWords, mbstr, count); + +#else + + /* Older Visual Studio or non-Microsoft compiler */ + size_t n; + + /* Convert to wide-character string (or count characters) */ + n = mbstowcs (wcstr, mbstr, sizeInWords); + if (!wcstr || n < count) { + + /* Zero-terminate output buffer */ + if (wcstr && sizeInWords) { + if (n >= sizeInWords) { + n = sizeInWords - 1; + } + wcstr[n] = 0; + } + + /* Length of resulting multi-byte string WITH zero terminator */ + if (pReturnValue) { + *pReturnValue = n + 1; + } + + /* Success */ + error = 0; + + } else { + + /* Could not convert string */ + error = 1; + + } + +#endif + + return error; +} + +/* Convert wide-character string to multi-byte string */ +static int +dirent_wcstombs_s( + size_t *pReturnValue, + char *mbstr, + size_t sizeInBytes, /* max size of mbstr */ + const wchar_t *wcstr, + size_t count) +{ + int error; + +#if defined(_MSC_VER) && _MSC_VER >= 1400 + + /* Microsoft Visual Studio 2005 or later */ + error = wcstombs_s (pReturnValue, mbstr, sizeInBytes, wcstr, count); + +#else + + /* Older Visual Studio or non-Microsoft compiler */ + size_t n; + + /* Convert to multi-byte string (or count the number of bytes needed) */ + n = wcstombs (mbstr, wcstr, sizeInBytes); + if (!mbstr || n < count) { + + /* Zero-terminate output buffer */ + if (mbstr && sizeInBytes) { + if (n >= sizeInBytes) { + n = sizeInBytes - 1; + } + mbstr[n] = '\0'; + } + + /* Length of resulting multi-bytes string WITH zero-terminator */ + if (pReturnValue) { + *pReturnValue = n + 1; + } + + /* Success */ + error = 0; + + } else { + + /* Cannot convert string */ + error = 1; + + } + +#endif + + return error; +} + +/* Set errno variable */ +static void +dirent_set_errno( + int error) +{ +#if defined(_MSC_VER) && _MSC_VER >= 1400 + + /* Microsoft Visual Studio 2005 and later */ + _set_errno (error); + +#else + + /* Non-Microsoft compiler or older Microsoft compiler */ + errno = error; + +#endif +} + + +#ifdef __cplusplus +} +#endif +#endif /*DIRENT_H*/ + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/1/dir/readme.txt b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/1/dir/readme.txt new file mode 100644 index 00000000..a2302519 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/1/dir/readme.txt @@ -0,0 +1,4 @@ +This file ensures that the directory dir will be created accordingly when +you unzip dirent to your computer. The directory itself is needed by the +test program t-dirent. + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/1/file b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/1/file new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/2/Testfile-1.2.3.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/2/Testfile-1.2.3.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/2/file.txt b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/2/file.txt new file mode 100644 index 00000000..d32e0045 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/2/file.txt @@ -0,0 +1 @@ +This dummy file is needed by the test program t-dirent. diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/3zero.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/3zero.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/666.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/666.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/Qwerty-my-aunt.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/Qwerty-my-aunt.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/README.txt b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/README.txt new file mode 100644 index 00000000..43e64e13 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/README.txt @@ -0,0 +1,3 @@ +This directory contains some random files for the t-scandir test program. The +files are empty and only the file names matter. + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/aaa.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/aaa.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/dirent.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/dirent.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/empty.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/empty.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/sane-1.12.0.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/sane-1.12.0.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/sane-1.2.3.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/sane-1.2.3.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/sane-1.2.4.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/sane-1.2.4.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/zebra.dat b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/3/zebra.dat new file mode 100644 index 00000000..e69de29b diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-compile.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-compile.c new file mode 100644 index 00000000..ad91d92f --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-compile.c @@ -0,0 +1,47 @@ +/* + * Test program to make sure that dirent compiles cleanly with winsock. + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#ifdef WIN32 +# include +# include +#endif +#include +#include +#include + +int +main( + int argc, char *argv[]) +{ + struct dirent *dirp = NULL; + + (void) argc; + (void) argv; + +#ifdef _DIRENT_HAVE_D_TYPE + printf ("Has d_type\n"); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + printf ("Has d_namlen\n"); +#endif +#ifdef _D_EXACT_NAMLEN + printf ("Has _D_EXACT_NAMLEN\n"); +#endif +#ifdef _D_ALLOC_NAMLEN + printf ("Has _D_ALLOC_NAMLEN\n"); +#endif +#ifdef _D_ALLOC_NAMLEN + printf ("Has _D_ALLOC_NAMLEN\n"); +#endif + printf ("Length of d_name with termitor: %d\n", sizeof (dirp->d_name)); + + printf ("OK\n"); + return EXIT_SUCCESS; +} + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-cplusplus.cpp b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-cplusplus.cpp new file mode 100644 index 00000000..11ed66a5 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-cplusplus.cpp @@ -0,0 +1,161 @@ +/* + * Test program to make sure that dirent compiles cleanly with C++ + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#include +using namespace std; + + +/* Filter and sort functions */ +static int only_readme (const struct dirent *entry); + + +int +main( + int argc, char *argv[]) +{ + (void) argc; + (void) argv; + + /* Basic directory retrieval */ + { + DIR *dir; + struct dirent *ent; + int found = 0; + + /* Open directory */ + dir = opendir ("tests/1"); + if (dir == NULL) { + cerr << "Directory tests/1 not found" << endl; + abort (); + } + + /* Read entries */ + while ((ent = readdir (dir)) != NULL) { + + /* Check each file */ + if (strcmp (ent->d_name, ".") == 0) { + /* Directory itself */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 1); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 1); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 1); +#endif + found += 1; + + } else if (strcmp (ent->d_name, "..") == 0) { + /* Parent directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 2); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 2); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 2); +#endif + found += 2; + + } else if (strcmp (ent->d_name, "file") == 0) { + /* Regular file */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_REG); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 4); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 4); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 4); +#endif + found += 4; + + } else if (strcmp (ent->d_name, "dir") == 0) { + /* Just a directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 3); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 3); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 3); +#endif + found += 8; + + } else { + /* Other file */ + cerr << "Unexpected file " << ent->d_name << endl; + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + closedir (dir); + } + + /* Basic scan with simple filter function */ + { + struct dirent **files; + int n; + int i; + + /* Read directory entries */ + n = scandir ("tests/3", &files, only_readme, alphasort); + assert (n == 1); + + /* Make sure that the filter works */ + assert (strcmp (files[0]->d_name, "README.txt") == 0); + + /* Release file names */ + for (i = 0; i < n; i++) { + free (files[i]); + } + free (files); + } + + + cout << "OK" << endl; + return EXIT_SUCCESS; +} + +/* Only pass README.txt file */ +static int +only_readme (const struct dirent *entry) +{ + int pass; + + if (strcmp (entry->d_name, "README.txt") == 0) { + pass = 1; + } else { + pass = 0; + } + + return pass; +} + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-dirent.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-dirent.c new file mode 100644 index 00000000..25dad59c --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-dirent.c @@ -0,0 +1,603 @@ +/* + * A test program to make sure that dirent works correctly. + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#ifdef _MSC_VER +# include +# define chdir(x) _chdir(x) +#else +# include +#endif +#include +#include + +#undef NDEBUG +#include + + +int +main( + int argc, char *argv[]) +{ + (void) argc; + (void) argv; + + /* File type macros */ + { + assert (DTTOIF(DT_REG) == S_IFREG); + assert (DTTOIF(DT_DIR) == S_IFDIR); + assert (DTTOIF(DT_FIFO) == S_IFIFO); + assert (DTTOIF(DT_SOCK) == S_IFSOCK); + assert (DTTOIF(DT_CHR) == S_IFCHR); + assert (DTTOIF(DT_BLK) == S_IFBLK); + + assert (IFTODT(S_IFREG) == DT_REG); + assert (IFTODT(S_IFDIR) == DT_DIR); + assert (IFTODT(S_IFIFO) == DT_FIFO); + assert (IFTODT(S_IFSOCK) == DT_SOCK); + assert (IFTODT(S_IFCHR) == DT_CHR); + assert (IFTODT(S_IFBLK) == DT_BLK); + } + + /* Basic directory retrieval */ + { + DIR *dir; + struct dirent *ent; + int found = 0; + + /* Open directory */ + dir = opendir ("tests/1"); + if (dir == NULL) { + fprintf (stderr, "Directory tests/1 not found\n"); + abort (); + } + + /* Read entries */ + while ((ent = readdir (dir)) != NULL) { + + /* Check each file */ + if (strcmp (ent->d_name, ".") == 0) { + /* Directory itself */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 1); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 1); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 1); +#endif + found += 1; + + } else if (strcmp (ent->d_name, "..") == 0) { + /* Parent directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 2); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 2); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 2); +#endif + found += 2; + + } else if (strcmp (ent->d_name, "file") == 0) { + /* Regular file */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_REG); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 4); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 4); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 4); +#endif + found += 4; + + } else if (strcmp (ent->d_name, "dir") == 0) { + /* Just a directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 3); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 3); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 3); +#endif + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file %s\n", ent->d_name); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + closedir (dir); + } + + /* Rewind of directory stream */ + { + DIR *dir; + struct dirent *ent; + int found = 0; + + /* Open directory */ + dir = opendir ("tests/1"); + assert (dir != NULL); + + /* Read entries */ + while ((ent = readdir (dir)) != NULL) { + + /* Check each file */ + if (strcmp (ent->d_name, ".") == 0) { + /* Directory itself */ + found += 1; + + } else if (strcmp (ent->d_name, "..") == 0) { + /* Parent directory */ + found += 2; + + } else if (strcmp (ent->d_name, "file") == 0) { + /* Regular file */ + found += 4; + + } else if (strcmp (ent->d_name, "dir") == 0) { + /* Just a directory */ + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file %s\n", ent->d_name); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + /* Rewind stream and read entries again */ + rewinddir (dir); + found = 0; + + /* Read entries */ + while ((ent = readdir (dir)) != NULL) { + + /* Check each file */ + if (strcmp (ent->d_name, ".") == 0) { + /* Directory itself */ + found += 1; + + } else if (strcmp (ent->d_name, "..") == 0) { + /* Parent directory */ + found += 2; + + } else if (strcmp (ent->d_name, "file") == 0) { + /* Regular file */ + found += 4; + + } else if (strcmp (ent->d_name, "dir") == 0) { + /* Just a directory */ + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file %s\n", ent->d_name); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + closedir (dir); + } + + /* Rewind with intervening change of working directory */ + { + DIR *dir; + struct dirent *ent; + int found = 0; + int errorcode; + + /* Open directory */ + dir = opendir ("tests/1"); + assert (dir != NULL); + + /* Read entries */ + while ((ent = readdir (dir)) != NULL) { + + /* Check each file */ + if (strcmp (ent->d_name, ".") == 0) { + /* Directory itself */ + found += 1; + + } else if (strcmp (ent->d_name, "..") == 0) { + /* Parent directory */ + found += 2; + + } else if (strcmp (ent->d_name, "file") == 0) { + /* Regular file */ + found += 4; + + } else if (strcmp (ent->d_name, "dir") == 0) { + /* Just a directory */ + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file %s\n", ent->d_name); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + /* Change working directory */ + errorcode = chdir ("tests"); + assert (errorcode == 0); + + /* Rewind stream and read entries again */ + rewinddir (dir); + found = 0; + + /* Read entries */ + while ((ent = readdir (dir)) != NULL) { + + /* Check each file */ + if (strcmp (ent->d_name, ".") == 0) { + /* Directory itself */ + found += 1; + + } else if (strcmp (ent->d_name, "..") == 0) { + /* Parent directory */ + found += 2; + + } else if (strcmp (ent->d_name, "file") == 0) { + /* Regular file */ + found += 4; + + } else if (strcmp (ent->d_name, "dir") == 0) { + /* Just a directory */ + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file %s\n", ent->d_name); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + /* Restore working directory */ + errorcode = chdir (".."); + assert (errorcode == 0); + + closedir (dir); + } + + /* Long file name */ + { + DIR *dir; + struct dirent *ent; + int found = 0; + + /* Open directory */ + dir = opendir ("tests/2"); + if (dir == NULL) { + fprintf (stderr, "Directory tests/2 not found\n"); + abort (); + } + + /* Read entries */ + while ((ent = readdir (dir)) != NULL) { + + /* Check each file */ + if (strcmp (ent->d_name, ".") == 0) { + /* Directory itself */ + found += 1; + + } else if (strcmp (ent->d_name, "..") == 0) { + /* Parent directory */ + found += 2; + + } else if (strcmp (ent->d_name, "file.txt") == 0) { + /* Regular 8+3 filename */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_REG); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 8); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 8); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 8); +#endif + found += 4; + + } else if (strcmp (ent->d_name, "Testfile-1.2.3.dat") == 0) { + /* Long file name with multiple dots */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (ent->d_type == DT_REG); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (ent->d_namlen == 18); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(ent) == 18); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(ent) > 18); +#endif + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file %s\n", ent->d_name); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + closedir (dir); + } + + /* Basic directory retrieval with readdir_r */ + { + DIR *dir; + struct dirent ent[10]; + struct dirent *entry; + size_t i = 0; + size_t n = 0; + int found = 0; + + /* Open directory */ + dir = opendir ("tests/1"); + if (dir == NULL) { + fprintf (stderr, "Directory tests/1 not found\n"); + abort (); + } + + /* Read entries to table */ + while (readdir_r (dir, &ent[n], &entry) == /*OK*/0 && entry != 0) { + n++; + assert (n <= 4); + } + + /* Make sure that we got all the files from directory */ + assert (n == 4); + + /* Check entries in memory */ + for (i = 0; i < 4; i++) { + entry = &ent[i]; + + /* Check each file */ + if (strcmp (entry->d_name, ".") == 0) { + /* Directory itself */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 1); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 1); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 1); +#endif + found += 1; + + } else if (strcmp (entry->d_name, "..") == 0) { + /* Parent directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 2); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 2); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 2); +#endif + found += 2; + + } else if (strcmp (entry->d_name, "file") == 0) { + /* Regular file */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_REG); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 4); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 4); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 4); +#endif + found += 4; + + } else if (strcmp (entry->d_name, "dir") == 0) { + /* Just a directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 3); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 3); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 3); +#endif + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file %s\n", entry->d_name); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + closedir (dir); + } + + /* Basic directory retrieval with _wreaddir_r */ +#ifdef WIN32 + { + _WDIR *dir; + struct _wdirent ent[10]; + struct _wdirent *entry; + size_t i = 0; + size_t n = 0; + int found = 0; + + /* Open directory */ + dir = _wopendir (L"tests/1"); + if (dir == NULL) { + fprintf (stderr, "Directory tests/1 not found\n"); + abort (); + } + + /* Read entries to table */ + while (_wreaddir_r (dir, &ent[n], &entry) == /*OK*/0 && entry != 0) { + n++; + assert (n <= 4); + } + + /* Make sure that we got all the files from directory */ + assert (n == 4); + + /* Check entries in memory */ + for (i = 0; i < 4; i++) { + entry = &ent[i]; + + /* Check each file */ + if (wcscmp (entry->d_name, L".") == 0) { + /* Directory itself */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 1); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 1); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 1); +#endif + found += 1; + + } else if (wcscmp (entry->d_name, L"..") == 0) { + /* Parent directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 2); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 2); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 2); +#endif + found += 2; + + } else if (wcscmp (entry->d_name, L"file") == 0) { + /* Regular file */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_REG); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 4); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 4); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 4); +#endif + found += 4; + + } else if (wcscmp (entry->d_name, L"dir") == 0) { + /* Just a directory */ +#ifdef _DIRENT_HAVE_D_TYPE + assert (entry->d_type == DT_DIR); +#endif +#ifdef _DIRENT_HAVE_D_NAMLEN + assert (entry->d_namlen == 3); +#endif +#ifdef _D_EXACT_NAMLEN + assert (_D_EXACT_NAMLEN(entry) == 3); +#endif +#ifdef _D_ALLOC_NAMLEN + assert (_D_ALLOC_NAMLEN(entry) > 3); +#endif + found += 8; + + } else { + /* Other file */ + fprintf (stderr, "Unexpected file\n"); + abort (); + } + + } + + /* Make sure that all files were found */ + assert (found == 0xf); + + _wclosedir (dir); + } +#endif + + printf ("OK\n"); + return EXIT_SUCCESS; +} + diff --git a/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-scandir.c b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-scandir.c new file mode 100644 index 00000000..ec6a6698 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/dirent-1.23.2/tests/t-scandir.c @@ -0,0 +1,153 @@ +/* + * Make sure that scandir function works OK. + * + * Copyright (C) 2006-2012 Toni Ronkko + * This file is part of dirent. Dirent may be freely distributed + * under the MIT license. For all details and documentation, see + * https://github.com/tronkko/dirent + */ +#include +#include +#include +#ifdef _MSC_VER +# include +#else +# include +#endif +#include +#include + +#undef NDEBUG +#include + + +/* Filter and sort functions */ +static int only_readme (const struct dirent *entry); +static int no_directories (const struct dirent *entry); +static int reverse_alpha (const struct dirent **a, const struct dirent **b); + + +int +main( + int argc, char *argv[]) +{ + struct dirent **files; + int i; + int n; + + (void) argc; + (void) argv; + + /* Basic scan with simple filter function */ + { + /* Read directory entries */ + n = scandir ("tests/3", &files, only_readme, alphasort); + assert (n == 1); + + /* Make sure that the filter works */ + assert (strcmp (files[0]->d_name, "README.txt") == 0); + + /* Release file names */ + for (i = 0; i < n; i++) { + free (files[i]); + } + free (files); + } + + /* Basic scan with default sorting function */ + { + /* Read directory entries in alphabetic order */ + n = scandir ("tests/3", &files, NULL, alphasort); + assert (n == 13); + + /* Make sure that we got all the file names in the proper order */ + assert (strcmp (files[0]->d_name, ".") == 0); + assert (strcmp (files[1]->d_name, "..") == 0); + assert (strcmp (files[2]->d_name, "3zero.dat") == 0); + assert (strcmp (files[3]->d_name, "666.dat") == 0); + assert (strcmp (files[4]->d_name, "Qwerty-my-aunt.dat") == 0); + assert (strcmp (files[5]->d_name, "README.txt") == 0); + assert (strcmp (files[6]->d_name, "aaa.dat") == 0); + assert (strcmp (files[7]->d_name, "dirent.dat") == 0); + assert (strcmp (files[8]->d_name, "empty.dat") == 0); + assert (strcmp (files[9]->d_name, "sane-1.12.0.dat") == 0); + assert (strcmp (files[10]->d_name, "sane-1.2.3.dat") == 0); + assert (strcmp (files[11]->d_name, "sane-1.2.4.dat") == 0); + assert (strcmp (files[12]->d_name, "zebra.dat") == 0); + + /* Release file names */ + for (i = 0; i < n; i++) { + free (files[i]); + } + free (files); + } + + /* Custom filter AND sort function */ + { + /* Read directory entries in alphabetic order */ + n = scandir ("tests/3", &files, no_directories, reverse_alpha); + assert (n == 11); + + /* Make sure that we got all the FILE names in the REVERSE order */ + assert (strcmp (files[0]->d_name, "zebra.dat") == 0); + assert (strcmp (files[1]->d_name, "sane-1.2.4.dat") == 0); + assert (strcmp (files[2]->d_name, "sane-1.2.3.dat") == 0); + assert (strcmp (files[3]->d_name, "sane-1.12.0.dat") == 0); + assert (strcmp (files[4]->d_name, "empty.dat") == 0); + assert (strcmp (files[5]->d_name, "dirent.dat") == 0); + assert (strcmp (files[6]->d_name, "aaa.dat") == 0); + assert (strcmp (files[7]->d_name, "README.txt") == 0); + assert (strcmp (files[8]->d_name, "Qwerty-my-aunt.dat") == 0); + assert (strcmp (files[9]->d_name, "666.dat") == 0); + assert (strcmp (files[10]->d_name, "3zero.dat") == 0); + + /* Release file names */ + for (i = 0; i < n; i++) { + free (files[i]); + } + free (files); + } + + printf ("OK\n"); + return EXIT_SUCCESS; +} + +/* Only pass README.txt file */ +static int +only_readme (const struct dirent *entry) +{ + int pass; + + if (strcmp (entry->d_name, "README.txt") == 0) { + pass = 1; + } else { + pass = 0; + } + + return pass; +} + +/* Filter out directories */ +static int +no_directories (const struct dirent *entry) +{ + int pass; + + if (entry->d_type != DT_DIR) { + pass = 1; + } else { + pass = 0; + } + + return pass; +} + +/* Sort in reverse direction */ +static int +reverse_alpha( + const struct dirent **a, const struct dirent **b) +{ + return strcoll ((*b)->d_name, (*a)->d_name); +} + + diff --git a/HW/HW/HWTask_5/File_Manager_V1/main.c b/HW/HW/HWTask_5/File_Manager_V1/main.c new file mode 100644 index 00000000..27111ae5 --- /dev/null +++ b/HW/HW/HWTask_5/File_Manager_V1/main.c @@ -0,0 +1,544 @@ +//#define _CRT_SECURE_NO_WARNINGS +// +//#include +//#include "dirent-1.23.2/include/dirent.h" // для работы с директориями +//#include // для установления размера файла +//#include +//#include +//#include +//#include +//#include "string.h" +// +// +//#define FILE_COUNT 50 +// +///// +///// функция, возвращающая размер файла +///// +///// полный или относительный путь до файла +///// размер файла +//int getFileSize(const char* file) { +// struct stat st; +// int full_size = 0; +// +// if (stat(file, &st) == 0) { +// // если это папка +// if ((st.st_mode & S_IFMT) == S_IFDIR) +// return -1; +// // если обычный файл +// else if ((st.st_mode & S_IFMT) == S_IFREG) +// return st.st_size; +// // если что-то иное (сокет, FIFO (именованный канал) и др.) +// else +// return -2; +// } +//} +// +///// +///// функция, печатающая названия файлов и размеры в каталоге и внутренних подкаталогов +///// +///// путь до каталога +//void getSizesFromDir(char* path, int fileSizeArray[], char** strs) { +// struct dirent* cur_file; +// DIR* dir; +// int count = 0; +// char full_file_path[200]; +// +// // открываем рабочую директорию +// dir = opendir(path); +// +// // если удалось открыть директорию +// if (dir) { +// // считываем файлы внутри директории в переменную cur_file, пока файлы не кончатся +// while ((cur_file = readdir(dir)) != NULL) { +// // игнорируем системные папки ./ и ../ +// // если попались записи, начинающиеся на . или .. - пропускаем их +// if (strcmp(".", cur_file->d_name) && strcmp("..", cur_file->d_name)) { +// // копируем путь в новую переменную, вставляем символ разделителя директории, +// // добавляем имя элемента (файла или папки) +// strcpy(full_file_path, strcat(strcat(strcpy(full_file_path, path), "/"), cur_file->d_name)); +// // получаем размер или -1, если это не файл, а вложенная папка +// int cur_file_size = getFileSize(full_file_path); +// if (cur_file_size >= 0) +// { +// // для файла печатаем его имя и размер +// printf("%s - %d B (%d kB)\n", cur_file->d_name, cur_file_size, cur_file_size / 1024); +// +// fileSizeArray[count] = cur_file_size; +// int k; +// for (k = 0; cur_file->d_name[k] != '\0'; k++) +// strs[count][k] = cur_file->d_name[k]; +// strs[count][k] = '\0'; +// count++; +// } +// else if (cur_file_size == -1) +// // для вложенной папки вызываем РЕКУРСИВНО написанный метод +// getSizesFromDir(full_file_path, fileSizeArray, strs); +// } +// } +// // не забываем закрыть директорию +// closedir(dir); +// } +// +//} +// +// +//void bubbleSort(int* num, int size) +//{ +// // Для всех элементов +// for (int i = 0; i < size - 1; i++) +// { +// for (int j = (size - 1); j > i; j--) // для всех элементов после i-ого +// { +// if (num[j - 1] > num[j]) // если текущий элемент меньше предыдущего +// { +// int temp = num[j - 1]; // меняем их местами +// num[j - 1] = num[j]; +// num[j] = temp; +// } +// } +// } +//} +// +//void merge(int* a, int n) +//{ +// int mid = n / 2; // находим середину сортируемой последовательности +// if (n % 2 == 1) +// mid++; +// int h = 1; // шаг +// // выделяем память под формируемую последовательность +// int* c = (int*)malloc(n * sizeof(int)); +// int step; +// while (h < n) +// { +// step = h; +// int i = 0; // индекс первого пути +// int j = mid; // индекс второго пути +// int k = 0; // индекс элемента в результирующей последовательности +// while (step <= mid) +// { +// while ((i < step) && (j < n) && (j < (mid + step))) +// { // пока не дошли до конца пути +// // заполняем следующий элемент формируемой последовательности +// // меньшим из двух просматриваемых +// if (a[i] < a[j]) +// { +// c[k] = a[i]; +// i++; k++; +// } +// else { +// c[k] = a[j]; +// j++; k++; +// } +// } +// while (i < step) +// { // переписываем оставшиеся элементы первого пути (если второй кончился раньше) +// c[k] = a[i]; +// i++; k++; +// } +// while ((j < (mid + step)) && (j < n)) +// { // переписываем оставшиеся элементы второго пути (если первый кончился раньше) +// c[k] = a[j]; +// j++; k++; +// } +// step = step + h; // переходим к следующему этапу +// } +// h = h * 2; +// // Переносим упорядоченную последовательность (промежуточный вариант) в исходный массив +// for (i = 0; i < n; i++) +// a[i] = c[i]; +// } +//} +// +//void hSort(int* A, int N) //N - длина массива A +//{ +// int temp; +// if (N <= 1) +// return; +// int l = 0, r = N - 1; //l - левая граница, r - правая +// int pivot = A[rand() % N]; +// while (l != r) +// { +// if (A[l] >= pivot) +// { +// if (A[r] < pivot) +// { +// temp = A[l]; +// A[l] = A[r]; +// A[r] = temp; +// l++; +// } +// if (l != r) r--; +// } +// else l++; +// } +// if (A[0] == A[N - 1]) return; //проверка на то, что мы сортируем не одинаковые элементы, чтоб не зацикл. +// hSort(A, l); +// hSort(A + l, N - l); +//} +// +//int main() { +// char path[200]; +// +// +// +// int* mass = NULL, *fileSizeArray = NULL, *fileSizeArray2, *fileSizeArray3, sort = 0; +// char* froBubblel; +// +// +// +// char** strs = (char**)malloc(FILE_COUNT * sizeof(char*)); +// for (int i = 0; i < FILE_COUNT; i++) { +// strs[i] = (char*)malloc(100 * sizeof(char)); +// } +// +// for (int i = 0; i < FILE_COUNT; i++) +// { +// for (int j = 0; j < FILE_COUNT; j++) +// { +// strs[i][j] = ' '; +// } +// +// } +// +// fileSizeArray = (int*)malloc(FILE_COUNT * sizeof(int)); +// fileSizeArray2 = (int*)malloc(FILE_COUNT * sizeof(int)); +// fileSizeArray3 = (int*)malloc(FILE_COUNT * sizeof(int)); +// +// +// +// // считываем путь (по сути scanf_s для строки) +// printf("Input path to dir: "); +// gets(path); +// getSizesFromDir(path, fileSizeArray, strs); +// +// int j = 0; +// +// for (int i = 0; i < FILE_COUNT; i++) { +// for (j = 0; j < 100; j++) { +// printf("%c", strs[i][j]); +// } +// printf("\n"); +// j = 0; +// +// } +// +// printf("\n------------------------------------------------------\n"); +// for (int i = 0; i < FILE_COUNT; i++) +// { +// if (fileSizeArray[i] > 0) +// { +// printf("\n%d", fileSizeArray[i]); +// } +// } +// printf("\n------------------------------------------------------\n"); +// for (int i = 0; i < FILE_COUNT; i++) +// { +// fileSizeArray2[i] = fileSizeArray[i]; +// } +// +// for (int i = 0; i < FILE_COUNT; i++) +// { +// fileSizeArray3[i] = fileSizeArray[i]; +// } +// printf("sort type:"); +// scanf_s("%d", &sort); +// switch(sort) +// { +// +// case 1: +// { +// bubbleSort(fileSizeArray2, FILE_COUNT); +// printf("bubbleSort: \n"); +// for (int i = 0; i < FILE_COUNT; i++) +// { +// if (fileSizeArray2[i] > 0) +// { +// printf("\n%d", fileSizeArray2[i]); +// } +// } +// break; +// } +// +// case 2: +// { +// merge(fileSizeArray3,FILE_COUNT); +// printf("mergesort: \n"); +// +// for (int i = 0; i < FILE_COUNT; i++) +// { +// if (fileSizeArray3[i] > 0) +// { +// printf("\n%d", fileSizeArray3[i]); +// } +// } +// break; +// } +// +// case 3: +// { +// hSort(fileSizeArray, FILE_COUNT); +// printf("hSort: \n"); +// for (int i = 0; i < FILE_COUNT; i++) +// { +// if (fileSizeArray[i] > 0) +// { +// printf("\n%d", fileSizeArray[i]); +// } +// } +// break; +// } +// } +// +// return 0; +//} +// +// +// +#define _CRT_SECURE_NO_WARNINGS + +#include +#include "dirent-1.23.2/include/dirent.h" +#include +#include +#include + +/// +/// функция, печатающая названия файлов и размеры в каталоге и внутренних подкаталогов +/// +/// путь до каталога +void getSizesFromDir(char* path, int fileSizeArray[], char** strs) { + struct dirent* cur_file; + DIR* dir; + int count = 0; + char full_file_path[200]; + + // открываем рабочую директорию + dir = opendir(path); + + // если удалось открыть директорию + if (dir) { + // считываем файлы внутри директории в переменную cur_file, пока файлы не кончатся + while ((cur_file = readdir(dir)) != NULL) { + // игнорируем системные папки ./ и ../ + // если попались записи, начинающиеся на . или .. - пропускаем их + if (strcmp(".", cur_file->d_name) && strcmp("..", cur_file->d_name)) { + // копируем путь в новую переменную, вставляем символ разделителя директории, + // добавляем имя элемента (файла или папки) + strcpy(full_file_path, strcat(strcat(strcpy(full_file_path, path), "/"), cur_file->d_name)); + // получаем размер или -1, если это не файл, а вложенная папка + int cur_file_size = getFileSize(full_file_path); + if (cur_file_size >= 0) + { + // для файла печатаем его имя и размер + printf("%s - %d B (%d kB)\n", cur_file->d_name, cur_file_size, cur_file_size / 1024); + int i, k;; + fileSizeArray[i] = cur_file_size; + int k; + for (k = 0; cur_file->d_name[k] != '\0'; k++) + strs[i][k] = cur_file->d_name[k]; + strs[i][k] = '\0'; + i++; + + } + else if (cur_file_size == -1) + // для вложенной папки вызываем РЕКУРСИВНО написанный метод + getSizesFromDir(full_file_path, fileSizeArray, strs); + } + } + // не забываем закрыть директорию + closedir(dir); + } + +} + +void selectionSort(int* arr1, char** arr2, int size) { + for (int i = 0; i < size - 1; i++) + { + int min_i = i; + + for (int j = i + 1; j < size; j++) + { + if (arr1[j] < arr1[min_i]) + { + min_i = j; + } + } + + if (min_i != i) + { + int temp = arr1[i]; + arr1[i] = arr1[min_i]; + arr1[min_i] = temp; + + char* temp2 = arr2[i]; + arr2[i] = arr2[min_i]; + arr2[min_i] = temp2; + + } + } + + int j = 0; + + for (int i = 0; i < size; i++) { + for (j = 0; j < 100; j++) { + printf("%c", arr2[i][j]); + } + j = 0; + printf(" - %d (B) (%d kB)\n", arr1[i], arr1[i] / 1024); + } +} + +void quickSort(int* arr1, int size, int first, int last, char** arr2) +{ + + int i = first, j = last; + int x = arr1[(first + last) / 2]; + do { + while (arr1[i] < x) { + i++; + } + while (arr1[j] > x) { + j--; + } + + if (i <= j) + { + if (i != j && arr1[i] != arr1[j]) + { + int temp = arr1[i]; + arr1[i] = arr1[j]; + arr1[j] = temp; + + char* temp2 = arr2[i]; + arr2[i] = arr2[j]; + arr2[j] = temp2; + } + i++; j--; + } + } while (i <= j); + + if (i < last) + quickSort(arr1, size, i, last, arr2); + if (first < j) + quickSort(arr1, size, first, j, arr2); + if (i == ((size - 1) / 2)) { + for (int i = 0; i < size; i++) { + for (j = 0; j < 100; j++) { + printf("%c", arr2[i][j]); + } + j = 0; + printf(" - %d (B) (%d kB)\n", arr1[i], arr1[i] / 1024); + } + } +} + + +#define MAX_FILE_COUNT 20 + +int main() { + + setlocale(LC_ALL, "LC_CTYPE=.utf8"); + + char path[200]; + + struct dirent* cur_file; + DIR* dir; + + int file_count = 0; + + char full_file_path[200]; + + int fileSizeArray[MAX_FILE_COUNT]; + + char** strs = (char**)malloc(MAX_FILE_COUNT * sizeof(char*)); + for (int i = 0; i < MAX_FILE_COUNT; i++) { + strs[i] = (char*)malloc(100 * sizeof(char)); + } + + char** strs2 = (char**)malloc(MAX_FILE_COUNT * sizeof(char*)); + for (int i = 0; i < MAX_FILE_COUNT; i++) { + strs2[i] = (char*)malloc(100 * sizeof(char)); + } + + char** strs3 = (char**)malloc(MAX_FILE_COUNT * sizeof(char*)); + for (int i = 0; i < MAX_FILE_COUNT; i++) { + strs3[i] = (char*)malloc(100 * sizeof(char)); + } + + int exit = 0; + + + printf("Input path to dir: "); + gets(path); + + + dir = opendir(path); + + file_count = getSizesFromDir(path, strs, fileSizeArray); + + do { + + int cFileSizeArray[MAX_FILE_COUNT]; + int cFileSizeArray2[MAX_FILE_COUNT]; + + for (int i = 0; i < file_count; i++) { + strs2[i] = strs[i]; + } + + for (int i = 0; i < file_count; i++) { + strs3[i] = strs[i]; + } + + for (int i = 0; i < file_count; i++) { + cFileSizeArray[i] = fileSizeArray[i]; + } + + for (int i = 0; i < file_count; i++) { + cFileSizeArray2[i] = fileSizeArray[i]; + } + + int sortSelect; + + printf("Enter type of sort you would like to do (1 - Selection, 2 - Quick, 3 - Merge): "); + scanf_s("%d", &sortSelect); + + switch (sortSelect) { + case 1: { + printf("-------------------------------------------\n"); + int time = clock(); + selectionSort(fileSizeArray, testchar2, file_count); + time = clock() - time; + printf("%d - time of work (ms)", time); + break; + } + case 2: { + printf("-------------------------------------------\n"); + int time = clock(); + quickSort(cFileSizeArray, file_count, 0, file_count - 1, testchar3); + time = clock() - time; + printf("%d - time of work (ms)", time); + break; + } + + case 3: { + printf("-------------------------------------------\n"); + int time = clock(); + mergeSort(cFileSizeArray2, testchar4, 0, file_count - 1, file_count); + time = clock() - time; + printf("%d - time of work (ms)", time); + break; + } + + default: { + printf("-------------------------------------------\n"); + printf("Error, wrong input."); + break; + } + } + printf("\nDo you want to exit the program? 1/0: "); + scanf_s("%d", &exit); + } while (exit != 1); + + return 0; +} \ No newline at end of file diff --git a/HW/HW/HWTask_5/HWTask_5.sln b/HW/HW/HWTask_5/HWTask_5.sln new file mode 100644 index 00000000..8a61b2db --- /dev/null +++ b/HW/HW/HWTask_5/HWTask_5.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "File_Manager_V1", "File_Manager_V1\File_Manager_V1.vcxproj", "{92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}" +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 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Debug|x64.ActiveCfg = Debug|x64 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Debug|x64.Build.0 = Debug|x64 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Debug|x86.ActiveCfg = Debug|Win32 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Debug|x86.Build.0 = Debug|Win32 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Release|x64.ActiveCfg = Release|x64 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Release|x64.Build.0 = Release|x64 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Release|x86.ActiveCfg = Release|Win32 + {92F653CD-ABA8-4D1D-8313-D7B4C205F7AC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {235E982C-6650-4D12-B8DD-957090DFEFBC} + EndGlobalSection +EndGlobal diff --git a/OOP/Task_1/.vs/Task_1/v16/.suo b/OOP/Task_1/.vs/Task_1/v16/.suo new file mode 100644 index 00000000..e71dcbda Binary files /dev/null and b/OOP/Task_1/.vs/Task_1/v16/.suo differ diff --git a/OOP/Task_1/.vs/Task_1/v16/Browse.VC.db b/OOP/Task_1/.vs/Task_1/v16/Browse.VC.db new file mode 100644 index 00000000..16102f19 Binary files /dev/null and b/OOP/Task_1/.vs/Task_1/v16/Browse.VC.db differ diff --git a/OOP/Task_1/.vs/Task_1/v16/ipch/AutoPCH/784786605bc6b698/SOURCE.ipch b/OOP/Task_1/.vs/Task_1/v16/ipch/AutoPCH/784786605bc6b698/SOURCE.ipch new file mode 100644 index 00000000..598f7136 Binary files /dev/null and b/OOP/Task_1/.vs/Task_1/v16/ipch/AutoPCH/784786605bc6b698/SOURCE.ipch differ diff --git a/OOP/Task_1/Task_1.sln b/OOP/Task_1/Task_1.sln new file mode 100644 index 00000000..e1fa6ac3 --- /dev/null +++ b/OOP/Task_1/Task_1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Task_1", "Task_1\Task_1.vcxproj", "{34396FAD-39C5-451A-A07A-BDCF4795AAF8}" +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 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Debug|x64.ActiveCfg = Debug|x64 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Debug|x64.Build.0 = Debug|x64 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Debug|x86.ActiveCfg = Debug|Win32 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Debug|x86.Build.0 = Debug|Win32 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Release|x64.ActiveCfg = Release|x64 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Release|x64.Build.0 = Release|x64 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Release|x86.ActiveCfg = Release|Win32 + {34396FAD-39C5-451A-A07A-BDCF4795AAF8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C4934A15-7102-48C6-9631-756284514856} + EndGlobalSection +EndGlobal diff --git a/OOP/Task_1/Task_1/Source.cpp b/OOP/Task_1/Task_1/Source.cpp new file mode 100644 index 00000000..205203e8 --- /dev/null +++ b/OOP/Task_1/Task_1/Source.cpp @@ -0,0 +1,71 @@ +#include +#include +using namespace std; +class Money +{ +public: + + double amount_of_money; + double summ; + int rub; + int cop; + + Money() + { + amount_of_money = 0, rub = 0, cop = 0, summ = 0; + } + + Money(int _rub, int _cop, double _amount_of_money) + { + + rub = _rub; + cop = _cop; + amount_of_money = _amount_of_money; + + } + void rub_cop(int _rub, int _cop) + { + _rub = amount_of_money + _rub; + _rub = _rub + _cop / 100; + _cop = _cop % 100; + } + + Money& operator=(const Money& right) + { + + if (this == &right) { + return *this; + } + rub = right.rub; + cop = right.cop; + return *this; + } + Money operator+(const Money&) + { + void rub_cop(int _rub, int _cop); + amount_of_money = amount_of_money + rub; + amount_of_money = (amount_of_money * 100) + cop; + } + + Money operator-(const Money&) + { + void rub_cop(int _rub, int _cop); + if (cop > 0) + { + rub - 1; + cop + 100; + } + amount_of_money = amount_of_money - rub; + amount_of_money = (amount_of_money * 100) - cop; + } + + + + + + + + + +}; + diff --git a/OOP/Task_1/Task_1/Task_1.vcxproj b/OOP/Task_1/Task_1/Task_1.vcxproj new file mode 100644 index 00000000..d7e0a030 --- /dev/null +++ b/OOP/Task_1/Task_1/Task_1.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {34396fad-39c5-451a-a07a-bdcf4795aaf8} + Task1 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/OOP/Task_1/Task_1/Task_1.vcxproj.filters b/OOP/Task_1/Task_1/Task_1.vcxproj.filters new file mode 100644 index 00000000..ef66db61 --- /dev/null +++ b/OOP/Task_1/Task_1/Task_1.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/OOP/Task_1/Task_1/Task_1.vcxproj.user b/OOP/Task_1/Task_1/Task_1.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/OOP/Task_1/Task_1/Task_1.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/OOP/Task_2/.vs/Task_2/v16/.suo b/OOP/Task_2/.vs/Task_2/v16/.suo new file mode 100644 index 00000000..01b0d26f Binary files /dev/null and b/OOP/Task_2/.vs/Task_2/v16/.suo differ diff --git a/OOP/Task_2/.vs/Task_2/v16/Browse.VC.db b/OOP/Task_2/.vs/Task_2/v16/Browse.VC.db new file mode 100644 index 00000000..199643fd Binary files /dev/null and b/OOP/Task_2/.vs/Task_2/v16/Browse.VC.db differ diff --git a/OOP/Task_2/.vs/Task_2/v16/ipch/AutoPCH/21f0abad144dcc93/SOURCE.ipch b/OOP/Task_2/.vs/Task_2/v16/ipch/AutoPCH/21f0abad144dcc93/SOURCE.ipch new file mode 100644 index 00000000..64a5baa4 Binary files /dev/null and b/OOP/Task_2/.vs/Task_2/v16/ipch/AutoPCH/21f0abad144dcc93/SOURCE.ipch differ diff --git a/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj b/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj new file mode 100644 index 00000000..19f38870 --- /dev/null +++ b/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {16197ac3-c8f9-4c8a-9f88-b7a62daa9bf4} + BIGNUMBER + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj.filters b/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj.filters new file mode 100644 index 00000000..ef66db61 --- /dev/null +++ b/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj.user b/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/OOP/Task_2/BIG_NUMBER/BIG_NUMBER.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.exe.recipe b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.exe.recipe new file mode 100644 index 00000000..911b5607 --- /dev/null +++ b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\OOP\Task_2\Debug\BIG_NUMBER.exe + + + + + + \ No newline at end of file diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.ilk b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.ilk new file mode 100644 index 00000000..b6c7a5e2 Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.ilk differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.log b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.log new file mode 100644 index 00000000..28dced73 --- /dev/null +++ b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.log @@ -0,0 +1,2 @@ + Source.cpp + BIG_NUMBER.vcxproj -> C:\git\Informatics-and-Programming\OOP\Task_2\Debug\BIG_NUMBER.exe diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/BIG_NUMBER.lastbuildstate b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/BIG_NUMBER.lastbuildstate new file mode 100644 index 00000000..fdbfecc1 --- /dev/null +++ b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/BIG_NUMBER.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\OOP\Task_2\| diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.command.1.tlog b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.command.1.tlog new file mode 100644 index 00000000..10e204a3 Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.command.1.tlog differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.read.1.tlog b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.read.1.tlog new file mode 100644 index 00000000..86c7170f Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.read.1.tlog differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.write.1.tlog b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.write.1.tlog new file mode 100644 index 00000000..89d592d9 Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/CL.write.1.tlog differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.command.1.tlog b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.command.1.tlog new file mode 100644 index 00000000..d93c32b7 Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.command.1.tlog differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.read.1.tlog b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.read.1.tlog new file mode 100644 index 00000000..d8facebe Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.read.1.tlog differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.write.1.tlog b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.write.1.tlog new file mode 100644 index 00000000..f0beb375 Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/BIG_NUMBER.tlog/link.write.1.tlog differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/Source.obj b/OOP/Task_2/BIG_NUMBER/Debug/Source.obj new file mode 100644 index 00000000..24c39453 Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/Source.obj differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/vc142.idb b/OOP/Task_2/BIG_NUMBER/Debug/vc142.idb new file mode 100644 index 00000000..544496ab Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/vc142.idb differ diff --git a/OOP/Task_2/BIG_NUMBER/Debug/vc142.pdb b/OOP/Task_2/BIG_NUMBER/Debug/vc142.pdb new file mode 100644 index 00000000..0faf68ba Binary files /dev/null and b/OOP/Task_2/BIG_NUMBER/Debug/vc142.pdb differ diff --git a/OOP/Task_2/BIG_NUMBER/Source.cpp b/OOP/Task_2/BIG_NUMBER/Source.cpp new file mode 100644 index 00000000..189e5a97 --- /dev/null +++ b/OOP/Task_2/BIG_NUMBER/Source.cpp @@ -0,0 +1,120 @@ +#include +#include + +using namespace std; + + + + +class Decimal +{ + int num; + unsigned char* massch; + int* massint; + int* massres; + + +public: + + Decimal(int size) + { + + num = size; + massch = new unsigned char[num]; + massint = new int[num]; + + void fill(); + { + char n; + for (int i = 0; i < num; i++) + { + cin >> n; + massch[i] = n; + } + + } + for (int i = 0; i < num; i++) + { + massint[i] = (int)massch[i] - 48; + } + + for (int i = 0, j = num - 1; i < j; i++, j--) + + { + int buf = massint[i]; + massint[i] = massint[j]; + massint[j] = buf; + } + } + Decimal() + { + + for (int i = 0; i < num; i++) + { + massres[i] = 0; + } + + } + + + + + void Out() + { + for (int i = 0; i < num; i++) + { + cout << massint[i] << endl; + } + } + + Decimal operator =(const Decimal first[] ) + { + for (int i = 0; i < num; i++) + { + if (this == &first[i]) + { + return *this; + } + } + + Decimal temp(num); + + for (int i = 0; i < num; i++) + { + + this->massint[i] = first->massint[i]; + this->massch[i] = first->massch[i]; + this->num = first->num; + this->num = first->massres[i]; + } + return *this; + } + Decimal operator+(Decimal first[]) + { + + Decimal temp(num); + + for (int i = 0; i < num; i++) + { + temp.massint[i] = massint[i] + first->massint[i]; + } + return temp; + } + +}; + +int main() +{ + + Decimal a(5), b(5); + + Decimal p; + + + + + + + +} + diff --git a/OOP/Task_2/Task_2.sln b/OOP/Task_2/Task_2.sln new file mode 100644 index 00000000..2a11af72 --- /dev/null +++ b/OOP/Task_2/Task_2.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BIG_NUMBER", "BIG_NUMBER\BIG_NUMBER.vcxproj", "{16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}" +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 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Debug|x64.ActiveCfg = Debug|x64 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Debug|x64.Build.0 = Debug|x64 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Debug|x86.ActiveCfg = Debug|Win32 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Debug|x86.Build.0 = Debug|Win32 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Release|x64.ActiveCfg = Release|x64 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Release|x64.Build.0 = Release|x64 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Release|x86.ActiveCfg = Release|Win32 + {16197AC3-C8F9-4C8A-9F88-B7A62DAA9BF4}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A8980BD7-B4EF-4AC3-B4CF-2CBC848AC82A} + EndGlobalSection +EndGlobal diff --git a/SolutionTasksInTerminal_2/SolutionTasksInTerminal_2.sln b/SolutionTasksInTerminal_2/SolutionTasksInTerminal_2.sln new file mode 100644 index 00000000..298ca1e0 --- /dev/null +++ b/SolutionTasksInTerminal_2/SolutionTasksInTerminal_2.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Witcher", "Witcher\Witcher.vcxproj", "{8722978B-1429-4F2F-BBBE-A0803B4E1259}" +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 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x64.ActiveCfg = Debug|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x64.Build.0 = Debug|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x86.ActiveCfg = Debug|Win32 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x86.Build.0 = Debug|Win32 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x64.ActiveCfg = Release|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x64.Build.0 = Release|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x86.ActiveCfg = Release|Win32 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9631F0D3-8D97-45EA-A353-67E97605AAE9} + EndGlobalSection +EndGlobal diff --git a/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj b/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj new file mode 100644 index 00000000..f043a511 --- /dev/null +++ b/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {8722978b-1429-4f2f-bbbe-a0803b4e1259} + Witcher + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.filters b/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.filters new file mode 100644 index 00000000..48814f71 --- /dev/null +++ b/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.user b/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.user new file mode 100644 index 00000000..0f14913f --- /dev/null +++ b/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SolutionTasksInTerminal_2/Witcher/main.c b/SolutionTasksInTerminal_2/Witcher/main.c new file mode 100644 index 00000000..d86fec12 --- /dev/null +++ b/SolutionTasksInTerminal_2/Witcher/main.c @@ -0,0 +1,39 @@ +#include +#include +#include + +int main() +{ + setlocale(LC_ALL, "Russian"); + + int price, coins = 0; + + printf (" : "); + scanf_s("%d", &price); + + while(price >= 25) + { + price = price - 25; + coins ++; + } + while(price >= 10) + { + price = price - 10; + coins++; + } + while(price >= 5) + { + price = price - 5; + coins++; + } + while (price >= 1 ) + { + price = price - 1; + coins++; + } + + + printf (" %d", coins); + + return 0; +} \ No newline at end of file diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/.suo b/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/.suo new file mode 100644 index 00000000..8d861393 Binary files /dev/null and b/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/.suo differ diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/Browse.VC.db b/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/Browse.VC.db new file mode 100644 index 00000000..39c2d9cd Binary files /dev/null and b/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/Browse.VC.db differ diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/ipch/AutoPCH/b99c7292514953d0/MAIN.ipch b/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/ipch/AutoPCH/b99c7292514953d0/MAIN.ipch new file mode 100644 index 00000000..a6d7fc01 Binary files /dev/null and b/TasksInTerminalClass/IndependentWork/IndependentWork_1/.vs/IndependentWork_1/v16/ipch/AutoPCH/b99c7292514953d0/MAIN.ipch differ diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/IndependentWork_1.sln b/TasksInTerminalClass/IndependentWork/IndependentWork_1/IndependentWork_1.sln new file mode 100644 index 00000000..846761d8 --- /dev/null +++ b/TasksInTerminalClass/IndependentWork/IndependentWork_1/IndependentWork_1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Task2", "Task2\Task2.vcxproj", "{88FC5681-0837-47D8-8BD0-70AA62E774D0}" +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 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Debug|x64.ActiveCfg = Debug|x64 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Debug|x64.Build.0 = Debug|x64 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Debug|x86.ActiveCfg = Debug|Win32 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Debug|x86.Build.0 = Debug|Win32 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Release|x64.ActiveCfg = Release|x64 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Release|x64.Build.0 = Release|x64 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Release|x86.ActiveCfg = Release|Win32 + {88FC5681-0837-47D8-8BD0-70AA62E774D0}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D1FABCA1-C24B-418E-9F50-141A18EA0386} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj new file mode 100644 index 00000000..666199e9 --- /dev/null +++ b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {88fc5681-0837-47d8-8bd0-70aa62e774d0} + Task2 + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj.filters b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj.user b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/Task2.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/main.c b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/main.c new file mode 100644 index 00000000..e3ff109a --- /dev/null +++ b/TasksInTerminalClass/IndependentWork/IndependentWork_1/Task2/main.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include +#define R 5 + +int main() +{ + int n, i, d, k, Bufer; + int a[R]; + + setlocale(LC_ALL, "Rus"); + srand(time(0)); + + printf (": \n"); + scanf_s("%d", &n); + printf (": a\n"); + for (i = 0; i < R; i++) + { + + a[i] = rand() % 200 - 100;; + printf("%d ", a[i]); + } + + printf("\n :\n", a[i]); + + + int rev = 0; + for (i = 0; i < R / 2; i++) { + rev = a[i]; + a[i] = a[R - i - 1]; + a[R - i - 1] = rev; + } + + for (i = R - 1; i > -1; i--) + { + printf("%d ", a[i]); + + } + + printf("\n\n :\n"); + for (i = 0; i < R; i++) + printf("%d ", a[i]); + return 0; + +} \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/.suo b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/.suo new file mode 100644 index 00000000..d2615e63 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/.suo differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/Browse.VC.db b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/Browse.VC.db new file mode 100644 index 00000000..b7c51732 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/Browse.VC.db differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/ipch/AutoPCH/7657db7fd8cdbe44/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/ipch/AutoPCH/7657db7fd8cdbe44/MAIN.ipch new file mode 100644 index 00000000..00fa647d Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/ipch/AutoPCH/7657db7fd8cdbe44/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/ipch/AutoPCH/e2a44b1e86389494/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/ipch/AutoPCH/e2a44b1e86389494/MAIN.ipch new file mode 100644 index 00000000..2e544629 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/.vs/SolutionTasksInTerminal_1/v16/ipch/AutoPCH/e2a44b1e86389494/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj new file mode 100644 index 00000000..85fcded5 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {62a6d639-741f-4108-ad58-657a5032d204} + CalculOfTheAvrCharacteristicsOfThreeIntegers + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj.filters b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj.user b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/main.c b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/main.c new file mode 100644 index 00000000..da955bb3 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/CalculOfTheAvrCharacteristicsOfThreeIntegers/main.c @@ -0,0 +1,82 @@ +#include +#include +#include + +int main() +{ + + setlocale(LC_ALL, "Rus"); + + int OpNumbber; + + printf(" : \n1 - \n2 - \n3 - \n4 - \n: "); + scanf_s("%d", &OpNumbber); + + switch (OpNumbber) + { + + case 1: + { + float number1, number2, number3, AVR; + + printf (" : "); + scanf_s("%f %f %f", &number1, &number2, &number3); + + AVR = (number1 + number2 + number3) / 3; + + printf(": %.2f", AVR); + + } + break; + + case 2: + { + float number1, number2, number3, AVRSQR; + + printf (" : "); + scanf_s("%f %f %f", &number1, &number2, &number3); + + AVRSQR = (pow(number1, 2) + pow(number2, 2) + pow(number3, 2)) / 3; + + printf(": %.2f", AVRSQR); + } + break; + + case 3: + { + float number1, number2, number3, AVRModule; + + printf (" : "); + scanf_s("%f %f %f", &number1, &number2, &number3); + + AVRModule = (fabsf(number1) + fabsf(number2) + fabsf(number3)) / 3; + + printf(": %.5f", AVRModule); + } + break; + + case 4: + { + float number1, number2, number3, AVGSQRT; + + printf (" : "); + scanf_s("%f %f %f", &number1, &number2, &number3); + + + AVGSQRT = (sqrtf(number1) + sqrtf(number2) + sqrtf(number3)) / 3; + + printf(": %.2f", AVGSQRT); + + } + break; + + default: + + printf(" , ."); + } + + + _getch(); + return 0; +} + diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/SolutionTasksInTerminal_1.sln b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/SolutionTasksInTerminal_1.sln new file mode 100644 index 00000000..5c49f837 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_1/SolutionTasksInTerminal_1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalculOfTheAvrCharacteristicsOfThreeIntegers", "CalculOfTheAvrCharacteristicsOfThreeIntegers\CalculOfTheAvrCharacteristicsOfThreeIntegers.vcxproj", "{62A6D639-741F-4108-AD58-657A5032D204}" +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 + {62A6D639-741F-4108-AD58-657A5032D204}.Debug|x64.ActiveCfg = Debug|x64 + {62A6D639-741F-4108-AD58-657A5032D204}.Debug|x64.Build.0 = Debug|x64 + {62A6D639-741F-4108-AD58-657A5032D204}.Debug|x86.ActiveCfg = Debug|Win32 + {62A6D639-741F-4108-AD58-657A5032D204}.Debug|x86.Build.0 = Debug|Win32 + {62A6D639-741F-4108-AD58-657A5032D204}.Release|x64.ActiveCfg = Release|x64 + {62A6D639-741F-4108-AD58-657A5032D204}.Release|x64.Build.0 = Release|x64 + {62A6D639-741F-4108-AD58-657A5032D204}.Release|x86.ActiveCfg = Release|Win32 + {62A6D639-741F-4108-AD58-657A5032D204}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1B5F19AE-CCB5-4B7D-8171-D20517171742} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/SolutionTasksInTerminal_2.sln b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/SolutionTasksInTerminal_2.sln new file mode 100644 index 00000000..cfeb274c --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/SolutionTasksInTerminal_2.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Witcher", "Witcher\Witcher.vcxproj", "{8722978B-1429-4F2F-BBBE-A0803B4E1259}" +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 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x64.ActiveCfg = Debug|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x64.Build.0 = Debug|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x86.ActiveCfg = Debug|Win32 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Debug|x86.Build.0 = Debug|Win32 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x64.ActiveCfg = Release|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x64.Build.0 = Release|x64 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x86.ActiveCfg = Release|Win32 + {8722978B-1429-4F2F-BBBE-A0803B4E1259}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9631F0D3-8D97-45EA-A353-67E97605AAE9} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj new file mode 100644 index 00000000..60864514 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {8722978b-1429-4f2f-bbbe-a0803b4e1259} + Witcher + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.filters b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.user b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/Witcher.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/main.c b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/main.c new file mode 100644 index 00000000..6a855b6a --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_2/Witcher/main.c @@ -0,0 +1,39 @@ +#include +#include +#include + +int main() +{ + setlocale(LC_ALL, "Russian"); + + int price, coins = 0; + + printf (" : "); + scanf_s("%d", &price); + + while(price >= 25) + { + price = price - 25; + coins ++; + } + while(price >= 10) + { + price = price - 10; + coins++; + } + while(price >= 5) + { + price = price - 5; + coins++; + } + while (price >= 1 ) + { + price = price - 1; + coins++; + } + + + printf (" %d", coins); + + return 0; +} \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/.suo b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/.suo new file mode 100644 index 00000000..2e95baaa Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/.suo differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/Browse.VC.db b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/Browse.VC.db new file mode 100644 index 00000000..29fc4e62 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/Browse.VC.db differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/ipch/AutoPCH/5b432464514acad5/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/ipch/AutoPCH/5b432464514acad5/MAIN.ipch new file mode 100644 index 00000000..cbbb0614 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/.vs/SolutionTasksInTerminal_3/v16/ipch/AutoPCH/5b432464514acad5/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj new file mode 100644 index 00000000..15d36c63 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {d4222eef-95e9-4648-9c34-ec77379893b3} + InversNumber + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj.filters b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj.user b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/InversNumber.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/main.c b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/main.c new file mode 100644 index 00000000..ec13d595 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/InversNumber/main.c @@ -0,0 +1,46 @@ +#include +#include +#include + +int main() +{ + setlocale(LC_ALL, "Russian"); + int number, isError = 0, isWork = 1; + while (isWork) + { + printf("Let's invers numbers!\n"); + printf("For exit enter 0\n"); + do + { + if (isError) + + printf ("Wrong input! Try again\n"); + + printf ("Imput positiv number: "); + scanf_s("%d", &number); + + if (number == 0) + { + isWork = 0; + break; + } + isError = (number <= 0); + + } while (isError); + + int invers = 0; + + while (number != 0) + { + invers = invers * 10 + number % 10; + + number = number / 10; + + } + + printf("Result: %d", invers); + break; + } + + return 0; +} \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/SolutionTasksInTerminal_3.sln b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/SolutionTasksInTerminal_3.sln new file mode 100644 index 00000000..4cea49f2 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_3/SolutionTasksInTerminal_3.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InversNumber", "InversNumber\InversNumber.vcxproj", "{D4222EEF-95E9-4648-9C34-EC77379893B3}" +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 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Debug|x64.ActiveCfg = Debug|x64 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Debug|x64.Build.0 = Debug|x64 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Debug|x86.ActiveCfg = Debug|Win32 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Debug|x86.Build.0 = Debug|Win32 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Release|x64.ActiveCfg = Release|x64 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Release|x64.Build.0 = Release|x64 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Release|x86.ActiveCfg = Release|Win32 + {D4222EEF-95E9-4648-9C34-EC77379893B3}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3EC5DA50-B9E2-4BCA-A7E2-A6BA06E76889} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/.suo b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/.suo new file mode 100644 index 00000000..174122e0 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/.suo differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/Browse.VC.db b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/Browse.VC.db new file mode 100644 index 00000000..c1bbeaa1 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/Browse.VC.db differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/ipch/AutoPCH/80521592040369b2/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/ipch/AutoPCH/80521592040369b2/MAIN.ipch new file mode 100644 index 00000000..8b5b538b Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/ipch/AutoPCH/80521592040369b2/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/ipch/AutoPCH/8736758e3a2ecb40/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/ipch/AutoPCH/8736758e3a2ecb40/MAIN.ipch new file mode 100644 index 00000000..8b586453 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/.vs/SolutionsTasksInTerminal_4/v16/ipch/AutoPCH/8736758e3a2ecb40/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj new file mode 100644 index 00000000..7a3d07fa --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {37b36d83-5a60-4e4b-ab03-1a14db92d4a2} + ActionsWithArrays + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj.filters b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj.user b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/ActionsWithArrays.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/main.c b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/main.c new file mode 100644 index 00000000..de33832d --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/ActionsWithArrays/main.c @@ -0,0 +1,121 @@ +#include +#include +#include + +#define SIZE 10 +/* +* +* +* +* 1. +* 2. +* 3. +* ------ +* ------ +* ------ +* ------ +* ------ ( , ) +* ------ ( mass[] = 1, 2, 3 => mass[] = 3, 2, 1 +* ------ 1 +*/ + + + +int main() +{ + setlocale(LC_ALL, "Russian"); + + printf("Topic ARRAYS\n"); + + int size; + printf("Imput size of dinamic array: "); + scanf_s("%d", &size); + + float* mass; + + mass = (float*)malloc(size * sizeof(float)); + + int i; + + for (i = 0; i < size; i++) + { + mass[i] = i + 1; + } + for ( i = 0; i < size; i++) + { + printf("%.1f ", mass[i]); + } + float sum_even_el = 0.0; + float sum_even_indx = 0.0; + float sum_even_values = 0.0; + for ( i = 0; i < size; i++) + { + if ((i + 1) % 2 == 0) + { + sum_even_el = sum_even_el + mass[i]; + } + else + { + sum_even_indx = sum_even_indx + mass[i]; + } + if ((int)mass[i] % 2 == 0) + { + sum_even_values = sum_even_values + mass[i]; + } + + + } + printf("\nSum of even elements: %.1f", sum_even_el); + printf("\nSum of elements with even index: %.1f", sum_even_el); + printf("\nSum of elements with even value: %d", sum_even_values); + + int indx; + printf("\nImput index for replace: "); + scanf_s("%d", &indx); + + float new_value; + printf("\nImput new value for index: "); + scanf_s("%f", &new_value); + + mass[indx] = new_value; + + printf("Your array now:"); + for ( i = 0; i < size; i++) + { + + } + + /* + int massive[100] = { 0 }; // 100 + int mass_1 [10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + int mass_2 [5]; // 5 + int mass_3 [SIZE]; + + // + int size; + printf ("Imput size of dinamic array: "); + scanf_s("%d", &size); + + + // + float* mass; + // + // malloc(size) + // sizeof(float) + mass = (float*)malloc(size * sizeof(float)); + + // + int m1[10]; + int m2[SIZE]; + int m3[] = { 1, 2, 3, 4 }; + // * - , int* - + int* m4; // + + int sum = 0, indx = 0, new_value = 0; + + + printf("%d", mass[0]); + */ + free(mass); + return 0; +} \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/SolutionsTasksInTerminal_4.sln b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/SolutionsTasksInTerminal_4.sln new file mode 100644 index 00000000..5e66f043 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_4/SolutionsTasksInTerminal_4.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30907.101 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ActionsWithArrays", "ActionsWithArrays\ActionsWithArrays.vcxproj", "{37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}" +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 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Debug|x64.ActiveCfg = Debug|x64 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Debug|x64.Build.0 = Debug|x64 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Debug|x86.ActiveCfg = Debug|Win32 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Debug|x86.Build.0 = Debug|Win32 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Release|x64.ActiveCfg = Release|x64 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Release|x64.Build.0 = Release|x64 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Release|x86.ActiveCfg = Release|Win32 + {37B36D83-5A60-4E4B-AB03-1A14DB92D4A2}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F2F4C1C2-4252-487D-937E-1A375C3DFDF7} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/.suo b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/.suo new file mode 100644 index 00000000..c7aae68c Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/.suo differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/Browse.VC.db b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/Browse.VC.db new file mode 100644 index 00000000..15a7219b Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/Browse.VC.db differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/ipch/AutoPCH/753fbee84b14523b/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/ipch/AutoPCH/753fbee84b14523b/MAIN.ipch new file mode 100644 index 00000000..a9a5641a Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/ipch/AutoPCH/753fbee84b14523b/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/ipch/AutoPCH/b16d11ebff22542b/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/ipch/AutoPCH/b16d11ebff22542b/MAIN.ipch new file mode 100644 index 00000000..ebfe1825 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/.vs/SolutionTasksInTerminal_5/v16/ipch/AutoPCH/b16d11ebff22542b/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj new file mode 100644 index 00000000..6109e3ad --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {dc943ea2-8f2e-464a-b31a-c95a6d60c19d} + ARRAYS + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj.filters b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj.user b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/ARRAYS.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.exe.recipe b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.exe.recipe new file mode 100644 index 00000000..b6b4b69a --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\Debug\ARRAYS.exe + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.ilk b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.ilk new file mode 100644 index 00000000..005140b2 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.ilk differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.log b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.log new file mode 100644 index 00000000..ba9699ac --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.log @@ -0,0 +1,18 @@ + main.c +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(34,24): warning C4013: malloc: нет определения; предполагается "extern" с возвратом типа "int" +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(40,19): warning C4244: =: преобразование "int" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(92,27): warning C4244: =: преобразование "int" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(102,17): warning C4244: =: преобразование "float" в "int", возможна потеря данных +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(104,28): warning C4244: =: преобразование "int" в "float", возможна потеря данных +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(120,7): error C2086: int size: переопределение +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(28): message : см. объявление "size" +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(126,10): error C2086: float *mass: переопределение +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(32): message : см. объявление "mass" +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(139,16): error C2086: int indx: переопределение +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(71): message : см. объявление "indx" +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(139,36): warning C4142: "new_value": неопасное переопределение типа +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(75): message : см. объявление "new_value" +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(139,26): error C2086: float new_value: переопределение +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(75): message : см. объявление "new_value" +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(142,10): warning C4477: "printf": в строке форматирования "%d" требуется аргумент типа "int", но вариативный аргумент "1" имеет тип "double" +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\ARRAYS\main.c(144,7): warning C4013: free: нет определения; предполагается "extern" с возвратом типа "int" diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/ARRAYS.lastbuildstate b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/ARRAYS.lastbuildstate new file mode 100644 index 00000000..b7e44928 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/ARRAYS.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_5\| diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/CL.command.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/CL.command.1.tlog new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/CL.command.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.command.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.command.1.tlog new file mode 100644 index 00000000..a9d3c0eb Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.command.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.read.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.read.1.tlog new file mode 100644 index 00000000..9e641754 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.read.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.write.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.write.1.tlog new file mode 100644 index 00000000..0fcea13c Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/link.write.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/unsuccessfulbuild b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/ARRAYS.tlog/unsuccessfulbuild new file mode 100644 index 00000000..e69de29b diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/vc142.idb b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/vc142.idb new file mode 100644 index 00000000..688316ed Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/vc142.idb differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/vc142.pdb b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/vc142.pdb new file mode 100644 index 00000000..ff9bbb7b Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/Debug/vc142.pdb differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/main.c b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/main.c new file mode 100644 index 00000000..b12f6299 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/ARRAYS/main.c @@ -0,0 +1,150 @@ +#include +#include +#include +#include + + +int main() +{ + setlocale(LC_ALL, ("Russian")); +#define SIZE 10 + /* + * + * + * + * 1. + * 2. + * 3. + * ---- + * ---- + * ---- + * ---- + * ---- ( , ) + * ---- ( mass[] = 1, 2, 3 => mass[] = 3, 2, 1 + */ + + printf("Topic ARRAYS\n"); + + int size; + printf("Imput size of dinamic array: "); + scanf_s("%d", &size); + + float* mass; + + mass = (float*)malloc(size * sizeof(float)); + + int i; + + for (i = 0; i < size; i++) + { + mass[i] = i + 1; + } + + for (i = 0; i < size; i++) + { + printf("%.1f ", mass[i]); + } + float sum_even_el = 0.0; + float sum_even_indx = 0.0; + float sum_even_values = 0.0; + for (i = 0; i < size; i++) + { + if ((i + 1) % 2 == 0) + { + sum_even_el = sum_even_el + mass[i]; + } + else + { + sum_even_indx = sum_even_indx + mass[i]; + } + if ((int)mass[i] % 2 == 0) + { + sum_even_values = sum_even_values + mass[i]; + } + + + } + printf("\nSum of even elements: %.1f", sum_even_el); + printf("\nSum of elements with even index: %.1f", sum_even_indx); + printf("\nSum of elements with even value: %.1f", sum_even_values); + + int indx; + printf ("\nImput index for replace: "); + scanf_s("%d", &indx); + + float new_value; + printf ("\nImput new value for index: "); + scanf_s("%f", &new_value); + + mass[indx] = new_value; + + printf("Your array now:"); + for (i = 0; i < size; i++) + { + printf("%.1f ", mass[i]); + } + + printf ("\nImput index to replace for a the opposite value: "); + scanf_s("%d", &indx); + + float opposite_value; + + mass[indx] = indx * (-1); + + printf("Your array now:"); + for (i = 0; i < size; i++) + { + printf("%.1f ", mass[i]); + } + + int rev = 0; + for (i = 0; i < size / 2; i++) { + rev = mass[i]; + mass[i] = mass[size - i - 1]; + mass[size - i - 1] = rev; + } + printf("\nRevers array now:"); + for (i = 0; i < size; i++) + { + printf("%.1f ", mass[i]); + } + + + + int massive[100] = { 0 }; // 100 + int mass_1 [10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + int mass_2 [5]; // 5 + int mass_3 [SIZE]; + + // + int size; + printf ("Imput size of dinamic array: "); + scanf_s("%d", &size); + + + // + float* mass; + // + // malloc(size) + // sizeof(float) + mass = (float*)malloc(size * sizeof(float)); + + // + int m1[10]; + int m2[SIZE]; + int m3[] = { 1, 2, 3, 4 }; + // * - , int* - + int* m4; // + + int sum = 0, indx = 0, new_value = 0; + + + printf("%d", mass[0]); + + free(mass); + + + + + return 0; + } \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/Debug/ARRAYS.exe b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/Debug/ARRAYS.exe new file mode 100644 index 00000000..1fecf49b Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/Debug/ARRAYS.exe differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/Debug/ARRAYS.pdb b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/Debug/ARRAYS.pdb new file mode 100644 index 00000000..86cbef49 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/Debug/ARRAYS.pdb differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/SolutionTasksInTerminal_5.sln b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/SolutionTasksInTerminal_5.sln new file mode 100644 index 00000000..5a9285ec --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_5/SolutionTasksInTerminal_5.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ARRAYS", "ARRAYS\ARRAYS.vcxproj", "{DC943EA2-8F2E-464A-B31A-C95A6D60C19D}" +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 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Debug|x64.ActiveCfg = Debug|x64 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Debug|x64.Build.0 = Debug|x64 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Debug|x86.ActiveCfg = Debug|Win32 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Debug|x86.Build.0 = Debug|Win32 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Release|x64.ActiveCfg = Release|x64 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Release|x64.Build.0 = Release|x64 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Release|x86.ActiveCfg = Release|Win32 + {DC943EA2-8F2E-464A-B31A-C95A6D60C19D}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2F72A672-AA5C-499A-A4C7-E9190627622E} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/.suo b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/.suo new file mode 100644 index 00000000..61d04e33 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/.suo differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/Browse.VC.db b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/Browse.VC.db new file mode 100644 index 00000000..5dcdf3b4 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/Browse.VC.db differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/454e8dd8d0e2bf0e/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/454e8dd8d0e2bf0e/MAIN.ipch new file mode 100644 index 00000000..4948ca0d Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/454e8dd8d0e2bf0e/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/8ba1c4e1bd7c76/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/8ba1c4e1bd7c76/MAIN.ipch new file mode 100644 index 00000000..d017ce3d Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/8ba1c4e1bd7c76/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/a1260bb7be9014eb/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/a1260bb7be9014eb/MAIN.ipch new file mode 100644 index 00000000..5964adbf Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/a1260bb7be9014eb/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/b3554a725a73a67e/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/b3554a725a73a67e/MAIN.ipch new file mode 100644 index 00000000..43cf7ce6 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/.vs/SolutionTasksInTerminal_6/v16/ipch/AutoPCH/b3554a725a73a67e/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Debug/Recoding.exe b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Debug/Recoding.exe new file mode 100644 index 00000000..81036423 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Debug/Recoding.exe differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Debug/Recoding.pdb b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Debug/Recoding.pdb new file mode 100644 index 00000000..10bcd22c Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Debug/Recoding.pdb differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.exe.recipe b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.exe.recipe new file mode 100644 index 00000000..2f256bd3 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_6\Debug\Recoding.exe + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.ilk b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.ilk new file mode 100644 index 00000000..1d8ecaaf Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.ilk differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.log b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.log new file mode 100644 index 00000000..f83124d4 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.log @@ -0,0 +1,4 @@ + main.c +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_6\Recoding\main.c(62,74): warning C4244: =: преобразование "float" в "int", возможна потеря данных +C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_6\Recoding\main.c(86,59): warning C4244: =: преобразование "float" в "int", возможна потеря данных + Recoding.vcxproj -> C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_6\Debug\Recoding.exe diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.command.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.command.1.tlog new file mode 100644 index 00000000..2c32a171 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.command.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.read.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.read.1.tlog new file mode 100644 index 00000000..6852d33d Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.read.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.write.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.write.1.tlog new file mode 100644 index 00000000..bcb1a003 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/CL.write.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/Recoding.lastbuildstate b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/Recoding.lastbuildstate new file mode 100644 index 00000000..50e1214d --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/Recoding.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\TasksInTerminalClass\SolutionTasksInTerminal\SolutionTasksInTerminal_6\| diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.command.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.command.1.tlog new file mode 100644 index 00000000..4fb506c9 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.command.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.read.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.read.1.tlog new file mode 100644 index 00000000..71ea77fa Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.read.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.write.1.tlog b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.write.1.tlog new file mode 100644 index 00000000..9191ec1d Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/Recoding.tlog/link.write.1.tlog differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/main.obj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/main.obj new file mode 100644 index 00000000..86d75153 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/main.obj differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/vc142.idb b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/vc142.idb new file mode 100644 index 00000000..bd64204a Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/vc142.idb differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/vc142.pdb b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/vc142.pdb new file mode 100644 index 00000000..b6eed7da Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Debug/vc142.pdb differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj new file mode 100644 index 00000000..27d51a44 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {498dca65-edb6-4f45-af4b-3fead1c2def8} + Recoding + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj.filters b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj.user b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/Recoding.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/main.c b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/main.c new file mode 100644 index 00000000..dd0952d0 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/Recoding/main.c @@ -0,0 +1,250 @@ + +/* + . + + , . + + , . + . + . + , , . + +*/ + +#include +#include +#include +#include + +#define N 4 +#define M 3 +#define K 2 + + +void PrintMatrix(int** matrix, int STR, int STLB) //STR - , STLB - +{ + for (int i = 0; i < STR; i++) + { // + for (int j = 0; j < STLB; j++) + { + printf("%d ", matrix[i][j]); + } + printf("\n"); + } +} +void Memory(int** matrix, int STR, int STLB) // ( , ) +{ + matrix = (int**)malloc(STR * sizeof(int*)); + for (int i = 0; i < STR; i++) + matrix[i] = (int*)malloc(STLB * sizeof(int)); +} +void PrintVector(int * vector) // +{ + for (int i = 0; i < M; i++) + { + printf("%d ", vector[i]); + } +} +void Filling_vector(int * vector) // +{ + for (int i = 0; i < M; i++) + { + vector[i] = rand() % 10; + } +} +void Filling_matrix(int **matrix, int STR, int STLB) // +{ + int max = 4, min = 0; + for (int i = 0; i < STR; i++) + { + for (int j = 0; j < STLB; j++) + { + matrix[i][j] = (max - min) * ((float)rand() / RAND_MAX) + min; + } + } +} + +int main() { + int** matrix_A, ** matrix_B, ** matrix_C, ** result ,* vector_A, * vector_B, * vector_C, * vector_D; + int max = 4, min = 0, value = 0; + // ( ) + // N , M ( N x M) + + matrix_A = (int**)malloc(N * sizeof(int*)); + for (int i = 0; i < N; i++) + matrix_A[i] = (int*)malloc(M * sizeof(int)); + + // + Filling_matrix(matrix_A, N, M); + + printf("Matrix A =\n"); + // + PrintMatrix(matrix_A, N, M); + + // + + value = (max - min) * ((float)rand() / RAND_MAX) + min; + + // + result = (int**)malloc(N * sizeof(int*)); + for (int i = 0; i < N; i++) + result[i] = (int*)malloc(M * sizeof(int)); + + for (int i = 0; i < N; i++) { + for (int j = 0; j < M; j++) { + result[i][j] = matrix_A[i][j] * value; + } + } + + printf("Matrix A x %d =\n", value); + // + for (int i = 0; i < N; i++) { + for (int j = 0; j < M; j++) { + printf("%d ", result[i][j]); + } + printf("\n"); + } + + // + + result = (int**)malloc(M * sizeof(int*)); + for (int i = 0; i < M; i++) + result[i] = (int*)malloc(N * sizeof(int)); + + for (int i = 0; i < M; i++) { + for (int j = 0; j < N; j++) { + result[i][j] = matrix_A[j][i]; + } + } + + printf("Matrix AT =\n"); + // + PrintMatrix(result, M, N); + + // + for (int i = 0; i < M; i++) free(result[i]); + free(result); + + // + + matrix_B = (int**)malloc(M * sizeof(int*)); + for (int i = 0; i < M; i++) + matrix_B[i] = (int*)malloc(K * sizeof(int)); + + // + Filling_matrix(matrix_B, M, K); + + printf("Matrix B =\n"); + // + PrintMatrix(matrix_B, M, K); + + result = (int**)malloc(N * sizeof(int*)); + for (int i = 0; i < N; i++) + result[i] = (int*)malloc(K * sizeof(int)); + + for (int i = 0; i < N; i++) { + for (int j = 0; j < K; j++) { + result[i][j] = 0; + for (int k = 0; k < M; k++) { + result[i][j] += matrix_A[i][k] * matrix_B[k][j]; + } + } + } + + printf("Matrix AxB =\n"); + // + PrintMatrix(result, M, K); + + // + for (int i = 0; i < N; i++) free(result[i]); + free(result); + + // + matrix_C = (int**)malloc(N * sizeof(int*)); + for (int i = 0; i < N; i++) + matrix_C[i] = (int*)malloc(M * sizeof(int)); + + + // C A + Filling_matrix(matrix_C, N, M); + + printf("Matrix C =\n"); + // + PrintMatrix(matrix_C, N, M); + + + for (int i = 0; i < N; i++) + for (int j = 0; j < M; j++) + matrix_C[i][j] = matrix_A[i][j] + matrix_C[i][j]; + + // A C + + printf("Matrix A+C =\n"); + PrintMatrix(matrix_C, N, M); + + // + + vector_A = (int*)malloc(M * sizeof(int*)); + vector_B = (int*)malloc(M * sizeof(int*)); + vector_C = (int*)malloc(M * sizeof(int*)); + vector_D = (int*)malloc(M * sizeof(int*)); + + // + + Filling_vector(vector_A); + Filling_vector(vector_B); + Filling_vector(vector_D); + + // + + + printf("Vector A = \n"); + + PrintVector(vector_A); + printf("\nVector B = \n"); + PrintVector(vector_B); + printf("\nVector A * %d\n", value); + for(int i = 0; i < M; i++) + { + vector_C[i] = vector_A[i] * value; + } + + PrintVector(vector_C); + + + // + printf("\nVector A + B =\n"); + for (int i = 0; i < M; i++) + { + vector_A[i] = vector_A[i] + vector_B[i]; + } + + PrintVector(vector_A); + + printf("\nVector D = \n"); + PrintVector(vector_D); + // + printf("\nVector B * D = \n"); + for (int i = 0; i < M; i++) + { + vector_B[i] *= vector_D[i]; + } + PrintVector(vector_B); + + + + // + for (int i = 0; i < N; i++) free(matrix_A[i]); + free(matrix_A); + for (int i = 0; i < M; i++) free(matrix_B[i]); + free(matrix_B); + for (int i = 0; i < M; i++) free(matrix_C[i]); + free(matrix_C); + + free(vector_A); + free(vector_B); + free(vector_C); + free(vector_D); + + return 0; +} diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/SolutionTasksInTerminal_6.sln b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/SolutionTasksInTerminal_6.sln new file mode 100644 index 00000000..4584f649 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionTasksInTerminal_6/SolutionTasksInTerminal_6.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Recoding", "Recoding\Recoding.vcxproj", "{498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}" +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 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Debug|x64.ActiveCfg = Debug|x64 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Debug|x64.Build.0 = Debug|x64 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Debug|x86.ActiveCfg = Debug|Win32 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Debug|x86.Build.0 = Debug|Win32 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Release|x64.ActiveCfg = Release|x64 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Release|x64.Build.0 = Release|x64 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Release|x86.ActiveCfg = Release|Win32 + {498DCA65-EDB6-4F45-AF4B-3FEAD1C2DEF8}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5C5F4E45-0956-47F3-9E89-B186C667515D} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/.suo b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/.suo new file mode 100644 index 00000000..139cb398 Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/.suo differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/Browse.VC.db b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/Browse.VC.db new file mode 100644 index 00000000..a067063b Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/Browse.VC.db differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/ipch/AutoPCH/6a315443ca10ea9e/MAIN.ipch b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/ipch/AutoPCH/6a315443ca10ea9e/MAIN.ipch new file mode 100644 index 00000000..3735d98c Binary files /dev/null and b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/.vs/SolutionsTasksInTerminal/v16/ipch/AutoPCH/6a315443ca10ea9e/MAIN.ipch differ diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj new file mode 100644 index 00000000..049a8767 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {e9ffff14-06d1-4205-8998-31e06529307b} + CalculationsOfAreas + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj.filters b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj.filters new file mode 100644 index 00000000..669bc4ea --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj.user b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/CalculationsOfAreas.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/main.c b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/main.c new file mode 100644 index 00000000..7f39b103 --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/CalculationsOfAreas/main.c @@ -0,0 +1,75 @@ +#include +#include +#include + + + int main() + { + setlocale(LC_ALL, "Rus"); + int f; + + printf(" 1 S , 2 , 3 = "); + scanf_s("%d", &f); + + switch (f) + { + case 1: + + { + float a, h, S; + + printf(" : \na = "); + scanf_s("%f", &a); + printf("h = "); + scanf_s("%f", &h); + + S = 0.5 * a * h; + + printf(" = %.2f", S); + + } + break; + + case 2: + + + { + float a, b, S; + + printf(" : \n a = "); + scanf_s("%f", &a); + printf(" h = "); + scanf_s("%f", &b); + + S = a * b; + + printf(" = %.2f ", S); + + } + break; + + case 3: + + + { + float r, S, Pi = 3.14; + + printf(" :\n r = "); + scanf_s("%f", &r); + + S = pow(r, 2) * Pi; + + printf(" = %.2f", S); + + } + break; + + default: + + printf(" , ."); + + } + + _getch(); + return 0; + } \ No newline at end of file diff --git a/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/SolutionsTasksInTerminal.sln b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/SolutionsTasksInTerminal.sln new file mode 100644 index 00000000..ffdca6cf --- /dev/null +++ b/TasksInTerminalClass/SolutionTasksInTerminal/SolutionsTasksInTerminal_0/SolutionsTasksInTerminal.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalculationsOfAreas", "CalculationsOfAreas\CalculationsOfAreas.vcxproj", "{E9FFFF14-06D1-4205-8998-31E06529307B}" +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 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Debug|x64.ActiveCfg = Debug|x64 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Debug|x64.Build.0 = Debug|x64 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Debug|x86.ActiveCfg = Debug|Win32 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Debug|x86.Build.0 = Debug|Win32 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Release|x64.ActiveCfg = Release|x64 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Release|x64.Build.0 = Release|x64 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Release|x86.ActiveCfg = Release|Win32 + {E9FFFF14-06D1-4205-8998-31E06529307B}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1D2EC267-7050-4650-AFF3-2A3B9EAE8E6B} + EndGlobalSection +EndGlobal diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/.suo b/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/.suo new file mode 100644 index 00000000..25f705e9 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/.suo differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/Browse.VC.db b/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/Browse.VC.db new file mode 100644 index 00000000..45ed29e3 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/Browse.VC.db differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/ipch/AutoPCH/eee72450696ceb96/SOURCE.ipch b/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/ipch/AutoPCH/eee72450696ceb96/SOURCE.ipch new file mode 100644 index 00000000..f105298b Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/.vs/IndependentWorkOOP_1/v16/ipch/AutoPCH/eee72450696ceb96/SOURCE.ipch differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.exe.recipe b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.exe.recipe new file mode 100644 index 00000000..c56db962 --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.exe.recipe @@ -0,0 +1,11 @@ + + + + + C:\git\Informatics-and-Programming\TasksInTerminalClassOOP\IndependentWorkOOP_1\Debug\Distance.exe + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.ilk b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.ilk new file mode 100644 index 00000000..931956d6 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.ilk differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.log b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.log new file mode 100644 index 00000000..5df562a7 --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.log @@ -0,0 +1,3 @@ + Source.cpp +C:\git\Informatics-and-Programming\TasksInTerminalClassOOP\IndependentWorkOOP_1\Distance\Source.cpp(63): warning C4172: возвращение адреса локальной или временной переменной : p + Distance.vcxproj -> C:\git\Informatics-and-Programming\TasksInTerminalClassOOP\IndependentWorkOOP_1\Debug\Distance.exe diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.command.1.tlog b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.command.1.tlog new file mode 100644 index 00000000..2cc90b2f Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.command.1.tlog differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.read.1.tlog b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.read.1.tlog new file mode 100644 index 00000000..8c01c4fa Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.read.1.tlog differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.write.1.tlog b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.write.1.tlog new file mode 100644 index 00000000..7da24325 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/CL.write.1.tlog differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/Distance.lastbuildstate b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/Distance.lastbuildstate new file mode 100644 index 00000000..51c86199 --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/Distance.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|C:\git\Informatics-and-Programming\TasksInTerminalClassOOP\IndependentWorkOOP_1\| diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.command.1.tlog b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.command.1.tlog new file mode 100644 index 00000000..3088098a Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.command.1.tlog differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.read.1.tlog b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.read.1.tlog new file mode 100644 index 00000000..a8b97223 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.read.1.tlog differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.write.1.tlog b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.write.1.tlog new file mode 100644 index 00000000..dba1c0e3 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Distance.tlog/link.write.1.tlog differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Source.obj b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Source.obj new file mode 100644 index 00000000..903b5ea6 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/Source.obj differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/vc142.idb b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/vc142.idb new file mode 100644 index 00000000..b7759eae Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/vc142.idb differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/vc142.pdb b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/vc142.pdb new file mode 100644 index 00000000..7226d0d8 Binary files /dev/null and b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Debug/vc142.pdb differ diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj new file mode 100644 index 00000000..ceda0ca5 --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {edafee6a-a16a-4443-bc90-ae1efc728d66} + Distance + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj.filters b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj.filters new file mode 100644 index 00000000..ef66db61 --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj.user b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Distance.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Source.cpp b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Source.cpp new file mode 100644 index 00000000..fbb2a9ed --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/Distance/Source.cpp @@ -0,0 +1,161 @@ +#include +#include +#include + + +using namespace std; + + +class Distance +{ +private: + + int met; + +public: + Distance() + { + met = 0; + } + + Distance(int f, int var) + { + if (f==1) + { + met = var * 1000; + } + else + { + met = var * 1610; + } + } + Distance(int metp) + { + + met = metp; + + } + + + void print() + { + cout << this->met << endl; + } + + void to_miles(int var) + { + var = var / 1610; + } + + void to_kilometrs(int var) + { + var = var / 1000; + } + + + + Distance& operator+(const Distance& right) + { + Distance p; + + p.met = this->met + right.met; + + return p; + } + + Distance& operator-(const Distance& right) + { + Distance p; + + if (right.met > this->met) + { + cout << " !!!" << endl; + } + else + { + p.met = this->met - right.met; + + return p; + } + + } + + Distance& operator=(const Distance& right) + { + if (this == &right) + { + return *this; + } + + this->met = right.met; + + return *this; + } + + bool operator>(const Distance& right) + { + return (this->met > right.met); + } + + bool operator<(const Distance& right) + { + return (this->met < right.met); + } + + bool operator==(const Distance& right) + { + return (this->met == right.met); + } + + bool operator!=(const Distance& right) + { + return (this->met != right.met); + } + + bool operator>=(const Distance& right) + { + return (this->met >= right.met); + } + + bool operator<=(const Distance& right) + { + return (this->met <= right.met); + } + +}; + + + +int main() +{ + + setlocale(LC_ALL, "RUSSIAN"); + + int f = 0; + int var = 0; + int f1 = 0; + int var1 = 0; + + cout << " 1 - , 2 - " << endl; + cin >> f; + cout << " 1 " << endl; + cin >> var; + + Distance a(f, var); + + cout << " 1 - , 2 - " << endl; + cin >> f1; + cout << " 1 " << endl; + cin >> var1; + + Distance b(f, var1); + + + Distance r = a + b; + + + + + r.print(); + +} \ No newline at end of file diff --git a/TasksInTerminalClassOOP/IndependentWorkOOP_1/IndependentWorkOOP_1.sln b/TasksInTerminalClassOOP/IndependentWorkOOP_1/IndependentWorkOOP_1.sln new file mode 100644 index 00000000..f9dc6d94 --- /dev/null +++ b/TasksInTerminalClassOOP/IndependentWorkOOP_1/IndependentWorkOOP_1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Distance", "Distance\Distance.vcxproj", "{EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}" +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 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Debug|x64.ActiveCfg = Debug|x64 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Debug|x64.Build.0 = Debug|x64 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Debug|x86.ActiveCfg = Debug|Win32 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Debug|x86.Build.0 = Debug|Win32 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Release|x64.ActiveCfg = Release|x64 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Release|x64.Build.0 = Release|x64 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Release|x86.ActiveCfg = Release|Win32 + {EDAFEE6A-A16A-4443-BC90-AE1EFC728D66}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4D878C32-3FE1-4622-B2FB-97D2E907E731} + EndGlobalSection +EndGlobal