diff --git a/laba10/laba10.sln b/laba10/laba10.sln new file mode 100644 index 0000000..8a36a0b --- /dev/null +++ b/laba10/laba10.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35312.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "laba10", "laba10\laba10.vcxproj", "{A65E24A1-E870-4378-9D97-12A3B9E2FF9C}" +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 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Debug|x64.ActiveCfg = Debug|x64 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Debug|x64.Build.0 = Debug|x64 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Debug|x86.ActiveCfg = Debug|Win32 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Debug|x86.Build.0 = Debug|Win32 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Release|x64.ActiveCfg = Release|x64 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Release|x64.Build.0 = Release|x64 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Release|x86.ActiveCfg = Release|Win32 + {A65E24A1-E870-4378-9D97-12A3B9E2FF9C}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E4633F11-C4BA-4BC9-8F92-FF88A10BE7C7} + EndGlobalSection +EndGlobal diff --git a/laba10/laba10/laba10.vcxproj b/laba10/laba10/laba10.vcxproj new file mode 100644 index 0000000..11517b8 --- /dev/null +++ b/laba10/laba10/laba10.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {a65e24a1-e870-4378-9d97-12a3b9e2ff9c} + laba10 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + 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/laba10/laba10/laba10.vcxproj.filters b/laba10/laba10/laba10.vcxproj.filters new file mode 100644 index 0000000..55917a8 --- /dev/null +++ b/laba10/laba10/laba10.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/laba10/laba10/taask1-2c.cpp b/laba10/laba10/taask1-2c.cpp new file mode 100644 index 0000000..42c5619 --- /dev/null +++ b/laba10/laba10/taask1-2c.cpp @@ -0,0 +1,68 @@ +#include +#include + +// +void print_custom_table(int N, int M) { + for (int i = 1; i <= N; i++) { + for (int j = 1; j <= M; j++) { + printf("%d%d ", i, j); + } + printf("\n"); + } +} + +// +void print_pifagor_table() { + int i = 1, j; + do { + j = 1; + do { + printf("%3d ", i * j); + j++; + } while (j <= 10); + printf("\n"); + i++; + } while (i <= 10); +} + +int main() { + SetConsoleCP(1251); + SetConsoleOutputCP(1251); + int choice; + int N, M; + + while (1) { + printf(":\n"); + printf("1: 1. \n"); + printf("2: 2. \n"); + printf("0: \n"); + printf(" : "); + scanf_s("%d", &choice); + + switch (choice) { + case 1: + printf(" (N <= 9): "); + scanf_s("%d", &N); + printf(" (M <= 9): "); + scanf_s("%d", &M); + + if (N > 9 || M > 9) { + printf(": N M <= 9\n"); + } + else { + print_custom_table(N, M); + } + break; + case 2: + print_pifagor_table(); + break; + case 0: + printf(" .\n"); + return 0; + default: + printf(" . .\n"); + } + } + + return 0; +} \ No newline at end of file