diff --git a/LABA_9/LABA_9.sln b/LABA_9/LABA_9.sln new file mode 100644 index 0000000..e795887 --- /dev/null +++ b/LABA_9/LABA_9.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34221.43 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LABA_9", "LABA_9.vcxproj", "{F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}" +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 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Debug|x64.ActiveCfg = Debug|x64 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Debug|x64.Build.0 = Debug|x64 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Debug|x86.ActiveCfg = Debug|Win32 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Debug|x86.Build.0 = Debug|Win32 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Release|x64.ActiveCfg = Release|x64 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Release|x64.Build.0 = Release|x64 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Release|x86.ActiveCfg = Release|Win32 + {F3E38226-1E2E-45E6-AAA9-CFAEEC743E2E}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F7450C9C-D54B-4FAE-8FC4-F749AC7D7414} + EndGlobalSection +EndGlobal diff --git a/LABA_9/LABA_9.vcxproj b/LABA_9/LABA_9.vcxproj new file mode 100644 index 0000000..4c3afff --- /dev/null +++ b/LABA_9/LABA_9.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {f3e38226-1e2e-45e6-aaa9-cfaeec743e2e} + LABA9 + 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/LABA_9/LABA_9.vcxproj.filters b/LABA_9/LABA_9.vcxproj.filters new file mode 100644 index 0000000..ef66db6 --- /dev/null +++ b/LABA_9/LABA_9.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/LABA_9/Source.cpp b/LABA_9/Source.cpp new file mode 100644 index 0000000..db1f9eb --- /dev/null +++ b/LABA_9/Source.cpp @@ -0,0 +1,72 @@ +#include +#include +void print1to10(){ + int x = 1; + do { + printf("%d", x); + x++; + } while (x <= 10); +} +void print10to1() { + int x = 10; + do { + printf("%d", x); + x-=1; + } while (x >= 1); +} +void print5nechet() { + int x = 1, k = 1; + do { + printf("%d", x); + x += 2; + k++; + }while (k != 5); +} +void print100to10() { + int x = 100; + while (x >= 10) { + printf("%d", x); + x -= 10; + } +} +void print1000to100() { + int x = 1000; + while (x >= 100) { + printf("%d", x); + x -= 100; + } +} +void print1000to2() { + int x = 1000; + while (x >= 2) { + printf("%d", x); + x -= 2; + } +} +int main() { + int n = 0; + scanf_s("%d", &n); + switch (n) { + case 1: + print1to10(); + break; + case 2: + print10to1(); + break; + case 3: + print5nechet(); + break; + case 11: + print100to10(); + break; + case 12: + print1000to100(); + break; + case 20: + print1000to2(); + break; + default: + break; (n != 0); + } + return 0; +} \ No newline at end of file