index all files
5
.gitignore
vendored
@ -4,6 +4,11 @@
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||
|
||||
# my filter
|
||||
Лекции/
|
||||
array test/
|
||||
Helloworld/
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
|
31
Arrays/Arrays.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Arrays", "Arrays\Arrays.vcxproj", "{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}"
|
||||
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
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Debug|x64.Build.0 = Debug|x64
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Debug|x86.Build.0 = Debug|Win32
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Release|x64.ActiveCfg = Release|x64
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Release|x64.Build.0 = Release|x64
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Release|x86.ActiveCfg = Release|Win32
|
||||
{32E273E0-92B2-4A96-AA6B-1C20B4A8CF6F}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2CC826F5-18F9-4372-8E53-07CDC0F26658}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
135
Arrays/Arrays/Arrays.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{32e273e0-92b2-4a96-aa6b-1c20b4a8cf6f}</ProjectGuid>
|
||||
<RootNamespace>Arrays</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\geany\arrays.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
Arrays/Arrays/Arrays.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\geany\arrays.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
8
Arrays/Arrays/hello.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void hello() {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
printf("%d bruh its C language\n", i);
|
||||
}
|
||||
puts("lolo");
|
||||
}
|
16
Arrays/Arrays/main.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define M 3
|
||||
#define N 3
|
||||
|
||||
int main() {
|
||||
int arr[M][N] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
|
||||
for (int i = 0; i < M; i++) {
|
||||
for (int j = 0; j < N; j++) {
|
||||
printf("%d", arr[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
hello();
|
||||
return 0;
|
||||
}
|
86
geany/arrays.c
Normal file
@ -0,0 +1,86 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define M 3
|
||||
#define N 3
|
||||
|
||||
void printarr(int m, int n, int a[M][N]) {
|
||||
for (int i = 0; i < m; i++) {
|
||||
for (int j = 0; j < n; j++) {
|
||||
printf("%2d ", a[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void intmulti(int m, int n, int a[M][N], int x) {
|
||||
for (int i = 0; i < m; i++) {
|
||||
for (int j = 0; j < n; j++) {
|
||||
a[i][j] = a[i][j] * x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void addmx(int m, int n, int A[M][N], int B[M][N], int C[M][N]) {
|
||||
for (int i = 0; i < m; i++) {
|
||||
for (int j = 0; j < n; j++) {
|
||||
C[i][j] = A[i][j] + B[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mulmx(int m, int n, int A[M][N], int B[M][N], int C[M][N]) {
|
||||
for (int i = 0; i < m; i++) {
|
||||
for (int j = 0; j < n; j++) {
|
||||
for (int p = 0; p < n; p++)
|
||||
C[i][j] += + A[i][p] * B[p][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void transpone(int m, int n, int A[M][N], int At[M][N]) {
|
||||
for (int i = 0; i < m; i++) {
|
||||
for (int j = 0; j < n; j++) {
|
||||
At[i][j] = A[j][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
/*
|
||||
int A[2][2] = {{3, -2}, {5, -4}};
|
||||
int B[2][2] = {{3, 4}, {2, 5}};
|
||||
int C[2][2] = {{0, 0}, {0, 0}};
|
||||
mulmx(2, 2, A, B, C);
|
||||
printarr(2, 2, C);
|
||||
*/
|
||||
int A[M][N] = { {5, 8, -4}, {6, 9, -5}, {4, 7, -3} };
|
||||
int B[M][N] = { {3, 2, 5}, {4, -1, 3}, {9, 6, 5} };
|
||||
int C[M][N] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };
|
||||
/*int D[M][N] = {
|
||||
{1, 1, 1},
|
||||
{1, 1, 1},
|
||||
{1, 1, 1},
|
||||
};*/
|
||||
printarr(M, N, A);
|
||||
puts("");
|
||||
printarr(M, N, B);
|
||||
puts("");
|
||||
mulmx(M, N, A, B, C);
|
||||
printarr(M, N, C);
|
||||
puts("");
|
||||
//printarr(M, N, D);
|
||||
//puts("");
|
||||
|
||||
//addmx(M, N, A, B, C);
|
||||
//printarr(M, N, C);
|
||||
|
||||
//intmulti(M, N, A, 2);
|
||||
//printarr(M, N, A);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
int A[M][N] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
|
||||
int B[M][N] = { {1, 1, 1}, {1, 1, 1}, {1, 1, 1} };
|
||||
int C[M][N] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };*/
|
22
geany/helloworld.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main() {
|
||||
printf("default cp = %d\n", GetConsoleCP());
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
printf("new cp = %d\n", GetConsoleCP());
|
||||
//printf("%s\n", setlocale(LC_ALL, "Russian_Russia.866"));
|
||||
//printf("%s\n", setlocale(LC_CTYPE, ""));
|
||||
printf("Hello world! Ïðèâåò ìèð!\n");
|
||||
printf("%f\n", 1234567.89);
|
||||
char str[200];
|
||||
printf(" input text: ");
|
||||
fgets(str, sizeof(str), stdin);
|
||||
//scanf("%5[^\n]", str);
|
||||
printf("output text: %s", str);
|
||||
printf("lolol");
|
||||
return 0;
|
||||
}
|
||||
|
74
geany/lab2.c
Normal file
@ -0,0 +1,74 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <Windows.h>
|
||||
#include <locale.h>
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
void vector_angle() {
|
||||
float x1, y1, x2, y2;
|
||||
printf("Ââåäèòå êîîðäèíàòû âåêòîðîâ\n");
|
||||
printf("x1 = ");
|
||||
scanf_s("%f", &x1);
|
||||
printf("y1 = ");
|
||||
scanf_s("%f", &y1);
|
||||
printf("x2 = ");
|
||||
scanf_s("%f", &x2);
|
||||
printf("y2 = ");
|
||||
scanf_s("%f", &y2);
|
||||
printf("%.2f ãðàäóñîâ", 57.3 * acos((x1 * x2 + y1 * y2) / (sqrt(x1 * x1 + y1 * y1) * sqrt(x2 * x2 + y2 * y2))));
|
||||
}
|
||||
|
||||
void lc_freq() {
|
||||
float L, C;
|
||||
printf("L = ");
|
||||
scanf_s("%f", &L);
|
||||
printf("C = ");
|
||||
scanf_s("%f", &C);
|
||||
printf("%.2f Ãö", 1 / (2 * PI * sqrt(L * C)));
|
||||
}
|
||||
|
||||
void deposit() {
|
||||
int money, days;
|
||||
float rate, eff, result;
|
||||
printf("ñòàâêà â %% = ");
|
||||
scanf_s("%f", &rate);
|
||||
printf("ñóììà äåïîçèòà = ");
|
||||
scanf_s("%d", &money);
|
||||
printf("ñêîëüêî äíåé êàïèòàëèçàöèè â ãîä = ");
|
||||
scanf_s("%d", &days);
|
||||
result = money * pow((1 + (rate / 100) / days), days);
|
||||
eff = (result - money) / money * 100;
|
||||
printf("ýôôåêòèâíàÿ ñòàâêà = %.2f%% äîõîä = %.2f", eff, result - money);
|
||||
}
|
||||
|
||||
int main() {
|
||||
//setlocale(LC_ALL, "Russian");
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int num;
|
||||
printf("1. Ðàññ÷èòàòü óãîë ìåæäó äâóìÿ äâóõìåðíûìè âåêòîðàìè.\n");
|
||||
printf("2. Ðàññ÷èòàòü ðåçîíàíñíóþ ÷àñòîòó LC-êîíòóðà.\n");
|
||||
printf("3. Ðàññ÷èòàòü äîõîä ïî âêëàäó çà ãîä.\n");
|
||||
|
||||
printf("Âûáåðèòå ïðîãðàììó: ");
|
||||
scanf_s("%d", &num);
|
||||
|
||||
switch (num)
|
||||
{
|
||||
case 1:
|
||||
vector_angle();
|
||||
break;
|
||||
case 2:
|
||||
lc_freq();
|
||||
break;
|
||||
case 3:
|
||||
deposit();
|
||||
break;
|
||||
default:
|
||||
printf("Íå òîò íîìåð!");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
26
geany/lab3-2.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main() {
|
||||
int max, v1, v2, v3;
|
||||
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
printf("ââåäèòå 3 öåëûõ ÷èñëà: ");
|
||||
scanf_s("%d%d%d", &v1, &v2, &v3);
|
||||
max = v1;
|
||||
|
||||
if (v2 > max) {
|
||||
max = v2;
|
||||
}
|
||||
|
||||
if (v3 > max) {
|
||||
max = v3;
|
||||
}
|
||||
|
||||
printf("max = %d", max);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
20
geany/lab3-3.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int t;
|
||||
printf("òåìïåðàòóðà = ");
|
||||
scanf_s("%d", &t);
|
||||
|
||||
if (t < 18) printf("õîëîäíî");
|
||||
else if (t < 22) printf("ïðîõëàäíî");
|
||||
else if (t < 26) printf("òåïëî");
|
||||
else printf("æàðêî");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
23
geany/lab3-4.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int nums[5];
|
||||
int max;
|
||||
|
||||
printf("ââåäèòå 5 öåëûõ ÷èñåë: ");
|
||||
scanf_s("%d%d%d%d%d", &nums[0], &nums[1], &nums[2], &nums[3], &nums[4]);
|
||||
|
||||
max = nums[0];
|
||||
|
||||
for (int i = 1; i < 5; i++) {
|
||||
if (nums[i] > max) max = nums[i];
|
||||
}
|
||||
|
||||
printf("max = %d", max);
|
||||
|
||||
return 0;
|
||||
}
|
22
geany/lab3-7.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int v;
|
||||
printf("ñêîðîñòü ñàìîë¸òà â êì/÷ = ");
|
||||
scanf("%d", &v);
|
||||
|
||||
if (v > 3000) puts("ìãíîâåííî");
|
||||
else if (v > 1200) puts("î÷åíü áûñòðî");
|
||||
else if (v > 800) puts("áûñòðî");
|
||||
else if (v > 500) puts("íîðìàëüíî");
|
||||
else if (v > 200) puts("ìåäëåííî");
|
||||
else puts("î÷åíü ìåäëåííî");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
21
geany/lab4-1.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int n;
|
||||
printf("n = ");
|
||||
scanf("%d", &n);
|
||||
|
||||
int i = 1;
|
||||
do {
|
||||
printf("%d ", i);
|
||||
i += 1;
|
||||
} while (i <= n);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
22
geany/lab4-2.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int n;
|
||||
printf("n = ");
|
||||
scanf("%d", &n);
|
||||
|
||||
int i = 1;
|
||||
int step = 0;
|
||||
do {
|
||||
printf("2^%d = %d\n", step, i);
|
||||
i = i * 2;
|
||||
step += 1;
|
||||
} while (step <= n);
|
||||
|
||||
return 0;
|
||||
}
|
24
geany/lab4-3.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int sum, year;
|
||||
float percent;
|
||||
printf("sum = ");
|
||||
scanf("%d", &sum);
|
||||
printf("percent = ");
|
||||
scanf("%f", &percent);
|
||||
|
||||
year = 0;
|
||||
do {
|
||||
printf("%d RUB in %d year\n", sum, year);
|
||||
sum = (sum * (100 + percent)) / 100;
|
||||
year += 1;
|
||||
} while (year <= 10);
|
||||
|
||||
return 0;
|
||||
}
|
36
geany/lab4-6.c
Normal file
@ -0,0 +1,36 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
printf("num of fibonacchi numbers = ");
|
||||
scanf("%d", &n);
|
||||
|
||||
double a = 0.0;
|
||||
double b = 1.0;
|
||||
double c;
|
||||
|
||||
printf("0\n1\n");
|
||||
n = n - 2;
|
||||
do {
|
||||
c = a + b;
|
||||
a = b;
|
||||
if (b > c) {
|
||||
printf("overflow, remaining n = %d", n);
|
||||
break;
|
||||
}
|
||||
b = c;
|
||||
printf("%lf\n", c);
|
||||
n = n - 1;
|
||||
} while (n > 0);
|
||||
|
||||
puts("\n------------");
|
||||
|
||||
if (pow(2, 64) > 12200160415121876738.0) {
|
||||
printf("%f is bigger than %f", pow(2, 64), 12200160415121876738.0);
|
||||
} else {
|
||||
puts("12200160415121876738 is bigger");
|
||||
}
|
||||
//printf("%u", sizeof(12200160415121876738));
|
||||
return 0;
|
||||
}
|
BIN
lab1/diagram.png
Normal file
After Width: | Height: | Size: 71 KiB |
31
lab1/lab1.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab1", "lab1\lab1.vcxproj", "{DA39C008-B93D-44F0-8A3D-F658DFC530B9}"
|
||||
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
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Debug|x64.Build.0 = Debug|x64
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Debug|x86.Build.0 = Debug|Win32
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Release|x64.ActiveCfg = Release|x64
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Release|x64.Build.0 = Release|x64
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Release|x86.ActiveCfg = Release|Win32
|
||||
{DA39C008-B93D-44F0-8A3D-F658DFC530B9}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {450B6B2F-D003-49CA-951E-B5873A662743}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
135
lab1/lab1/lab1.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{da39c008-b93d-44f0-8a3d-f658dfc530b9}</ProjectGuid>
|
||||
<RootNamespace>lab1</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
lab1/lab1/lab1.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
44
lab1/lab1/main.c
Normal file
@ -0,0 +1,44 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void drawShip() {
|
||||
printf(" ____\n");
|
||||
printf(" ---|\n");
|
||||
printf(" \\/ /| \\/\n");
|
||||
printf(" / |\\\n");
|
||||
printf(" / | \\ \\/\n");
|
||||
printf(" / || \\\n");
|
||||
printf(" / | | \\\n");
|
||||
printf(" / | | \\\n");
|
||||
printf(" / | | \\\n");
|
||||
printf(" / || \\\n");
|
||||
printf(" / / \\\n");
|
||||
printf(" /________/ \\\n");
|
||||
printf(" ________/__________--/\n");
|
||||
printf(" ~~~ \\___________________/\n");
|
||||
printf(" ~~~~~~~~~~ ~~~~~~~~\n");
|
||||
printf("~~~~~~~~~~~~~ ~~~~~~~~~\n");
|
||||
printf(" ~~~~~~~~~");
|
||||
}
|
||||
|
||||
int main() {
|
||||
drawShip();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ____
|
||||
// ---|
|
||||
// \/ /| \/
|
||||
// / |\
|
||||
// / | \ \/
|
||||
// / || \
|
||||
// / | | \
|
||||
// / | | \
|
||||
// / | | \
|
||||
// / || \
|
||||
// / / \
|
||||
// /________/ \
|
||||
// ________/__________--/
|
||||
// ~~~ \___________________/
|
||||
// ~~~~~~~~~~ ~~~~~~~~
|
||||
//~~~~~~~~~~~~~ ~~~~~~~~~
|
||||
// ~~~~~~~~~
|
31
lab10/lab10.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab10", "lab10\lab10.vcxproj", "{656A5C2B-24D5-40ED-A852-3E38EDE307B0}"
|
||||
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
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Debug|x64.Build.0 = Debug|x64
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Debug|x86.Build.0 = Debug|Win32
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Release|x64.ActiveCfg = Release|x64
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Release|x64.Build.0 = Release|x64
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Release|x86.ActiveCfg = Release|Win32
|
||||
{656A5C2B-24D5-40ED-A852-3E38EDE307B0}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {FE0BD7A7-5DE3-4E9A-8CE7-60E8F5FCA1D0}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
138
lab10/lab10/lab10.vcxproj
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{656a5c2b-24d5-40ed-a852-3e38ede307b0}</ProjectGuid>
|
||||
<RootNamespace>lab10</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\numTriangle.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
27
lab10/lab10/lab10.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\numTriangle.png">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
127
lab10/lab10/main.c
Normal file
@ -0,0 +1,127 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
void printTable() {
|
||||
int i = 1;
|
||||
while (i <= 9) {
|
||||
int j = 1;
|
||||
while (j <= 9) {
|
||||
printf("%d%d ", i, j);
|
||||
j++;
|
||||
}
|
||||
i++;
|
||||
puts("");
|
||||
}
|
||||
}
|
||||
|
||||
void pithagoreanTable() {
|
||||
int i = 1;
|
||||
while (i <= 10) {
|
||||
int j = 1;
|
||||
while (j <= 10) {
|
||||
printf("%3d ", i * j);
|
||||
j++;
|
||||
}
|
||||
i++;
|
||||
puts("");
|
||||
}
|
||||
}
|
||||
|
||||
void numTriagle() {
|
||||
int n = 0;
|
||||
printf("N = ");
|
||||
scanf_s("%d", &n);
|
||||
int i = 0;
|
||||
while (i < n) {
|
||||
int j = i;
|
||||
while (j >= 0) {
|
||||
printf("%d ", n - j);
|
||||
j--;
|
||||
}
|
||||
puts("");
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void hardNumTriagle() {
|
||||
int n = 0;
|
||||
printf("N = ");
|
||||
scanf_s("%d", &n);
|
||||
int i = 0;
|
||||
while (i < n) {
|
||||
int space = n - i - 1;
|
||||
while (space > 0) {
|
||||
printf(" ");
|
||||
space--;
|
||||
}
|
||||
int j = i;
|
||||
while (j >= 0) {
|
||||
printf("%2d ", n - j);
|
||||
j--;
|
||||
}
|
||||
puts("");
|
||||
i++;
|
||||
}
|
||||
i--;
|
||||
while (i > 0) {
|
||||
int space = 0;
|
||||
while (space < n - i) {
|
||||
printf(" ");
|
||||
space++;
|
||||
}
|
||||
int j = i - 1;
|
||||
while (j >= 0) {
|
||||
printf("%2d ", n - j);
|
||||
j--;
|
||||
}
|
||||
puts("");
|
||||
i--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
int n = -1;
|
||||
int r = 0;
|
||||
do {
|
||||
puts("\n");
|
||||
puts("choose program");
|
||||
puts("1) print ij matrix");
|
||||
puts("2) print pithagorean table");
|
||||
puts("3) print number triangle");
|
||||
puts("4) print hard number triangle");
|
||||
puts("");
|
||||
puts("0) exit program");
|
||||
|
||||
while (scanf_s(" %d", &n) != 1) {
|
||||
scanf_s("%*[^\n]");
|
||||
scanf_s("%*c");
|
||||
}
|
||||
puts("");
|
||||
|
||||
switch (n)
|
||||
{
|
||||
case 1:
|
||||
printTable();
|
||||
break;
|
||||
case 2:
|
||||
pithagoreanTable();
|
||||
break;
|
||||
case 3:
|
||||
numTriagle();
|
||||
break;
|
||||
case 4:
|
||||
hardNumTriagle();
|
||||
break;
|
||||
case 0:
|
||||
puts("goodbye :3");
|
||||
break;
|
||||
default:
|
||||
puts("error: wrong N");
|
||||
break;
|
||||
}
|
||||
|
||||
} while (n != 0);
|
||||
return 0;
|
||||
}
|
1
lab10/numTriangle.json
Normal file
@ -0,0 +1 @@
|
||||
{"blocks":[{"x":555,"y":130,"text":"numTriangle","width":130,"height":20,"type":"Текст / комментарий","isMenuBlock":false,"fontSize":19,"textHeight":19,"isBold":true,"isItalic":false,"textAlign":"left","labelsPosition":1},{"x":550,"y":200,"text":"начало","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":270,"text":"ввод n","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":430,"text":"i < n","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":700,"y":640,"text":"вывод n - j","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":700,"y":550,"text":"j ≥ 0","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":700,"y":720,"text":"j = j - 1","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":340,"text":"i = 0","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":700,"y":470,"text":"j = i","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":550,"text":"вывод '\\n'","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":630,"text":"i = i + 1","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":390,"y":430,"text":"конец","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1}],"arrows":[{"startIndex":2,"endIndex":7,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":290},{"x":550,"y":300},{"x":550,"y":320}],"counts":[1,1,1]},{"startIndex":1,"endIndex":2,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":215},{"x":550,"y":230},{"x":550,"y":250}],"counts":[1,1,1]},{"startIndex":7,"endIndex":3,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":360},{"x":550,"y":390},{"x":550,"y":410}],"counts":[1,1,1]},{"startIndex":3,"endIndex":8,"startConnectorIndex":1,"endConnectorIndex":0,"nodes":[{"x":600,"y":430},{"x":700,"y":430},{"x":700,"y":450}],"counts":[1,1,1]},{"startIndex":5,"endIndex":4,"startConnectorIndex":1,"endConnectorIndex":0,"nodes":[{"x":750,"y":550},{"x":770,"y":550},{"x":770,"y":600},{"x":700,"y":600},{"x":700,"y":620}],"counts":[1,1,1,1,1]},{"startIndex":4,"endIndex":6,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":700,"y":660},{"x":700,"y":680},{"x":700,"y":700}],"counts":[1,1,1]},{"startIndex":8,"endIndex":5,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":700,"y":490},{"x":700,"y":510},{"x":700,"y":530}],"counts":[1,1,1]},{"startIndex":6,"endIndex":5,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":700,"y":740},{"x":700,"y":760},{"x":800,"y":760},{"x":800,"y":510},{"x":700,"y":510},{"x":700,"y":530}],"counts":[1,1,1,1,1,1]},{"startIndex":5,"endIndex":9,"startConnectorIndex":3,"endConnectorIndex":1,"nodes":[{"x":650,"y":550},{"x":630,"y":550},{"x":610,"y":550}],"counts":[1,1,1]},{"startIndex":9,"endIndex":10,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":570},{"x":550,"y":590},{"x":550,"y":610}],"counts":[1,1,1]},{"startIndex":10,"endIndex":3,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":650},{"x":550,"y":790},{"x":850,"y":790},{"x":850,"y":390},{"x":550,"y":390},{"x":550,"y":410}],"counts":[1,1,1,1,1,1]},{"startIndex":3,"endIndex":11,"startConnectorIndex":3,"endConnectorIndex":1,"nodes":[{"x":500,"y":430},{"x":460,"y":430},{"x":440,"y":430}],"counts":[1,1,1]}],"x0":-1129,"y0":-863}
|
BIN
lab10/numTriangle.png
Normal file
After Width: | Height: | Size: 134 KiB |
31
lab12/lab12.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab12", "lab12\lab12.vcxproj", "{45C15208-08C4-4B71-A4D6-B58EDC8DA968}"
|
||||
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
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Debug|x64.Build.0 = Debug|x64
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Debug|x86.Build.0 = Debug|Win32
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Release|x64.ActiveCfg = Release|x64
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Release|x64.Build.0 = Release|x64
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Release|x86.ActiveCfg = Release|Win32
|
||||
{45C15208-08C4-4B71-A4D6-B58EDC8DA968}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {14D2C521-5CAB-4F8D-ABBD-F284772C1B2C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
30
lab12/lab12/Resource.h
Normal file
@ -0,0 +1,30 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Включаемый файл, созданный в Microsoft Visual C++.
|
||||
// Используется lab12.rc
|
||||
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_LAB12_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_LAB12 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_LAB12 109
|
||||
#define IDC_MYICON 2
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
// Следующие стандартные значения для новых объектов
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NO_MFC 130
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
15
lab12/lab12/framework.h
Normal file
@ -0,0 +1,15 @@
|
||||
// header.h: включаемый файл для стандартных системных включаемых файлов
|
||||
// или включаемые файлы для конкретного проекта
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#define WIN32_LEAN_AND_MEAN // Исключите редко используемые компоненты из заголовков Windows
|
||||
// Файлы заголовков Windows
|
||||
#include <windows.h>
|
||||
// Файлы заголовков среды выполнения C
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
331
lab12/lab12/lab12.cpp
Normal file
@ -0,0 +1,331 @@
|
||||
// lab12.cpp : Определяет точку входа для приложения.
|
||||
//
|
||||
|
||||
#include "framework.h"
|
||||
#include "lab12.h"
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
// Глобальные переменные:
|
||||
HINSTANCE hInst; // текущий экземпляр
|
||||
WCHAR szTitle[MAX_LOADSTRING]; // Текст строки заголовка
|
||||
WCHAR szWindowClass[MAX_LOADSTRING]; // имя класса главного окна
|
||||
|
||||
// Отправить объявления функций, включенных в этот модуль кода:
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
// TODO: Разместите код здесь.
|
||||
|
||||
// Инициализация глобальных строк
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_LAB12, szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Выполнить инициализацию приложения:
|
||||
if (!InitInstance (hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_LAB12));
|
||||
|
||||
MSG msg;
|
||||
|
||||
// Цикл основного сообщения:
|
||||
while (GetMessage(&msg, nullptr, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: MyRegisterClass()
|
||||
//
|
||||
// ЦЕЛЬ: Регистрирует класс окна.
|
||||
//
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASSEXW wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
|
||||
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wcex.lpfnWndProc = WndProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_LAB12));
|
||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_LAB12);
|
||||
wcex.lpszClassName = szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
|
||||
return RegisterClassExW(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: InitInstance(HINSTANCE, int)
|
||||
//
|
||||
// ЦЕЛЬ: Сохраняет маркер экземпляра и создает главное окно
|
||||
//
|
||||
// КОММЕНТАРИИ:
|
||||
//
|
||||
// В этой функции маркер экземпляра сохраняется в глобальной переменной, а также
|
||||
// создается и выводится главное окно программы.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Сохранить маркер экземпляра в глобальной переменной
|
||||
|
||||
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
|
||||
|
||||
if (!hWnd)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void drawNet(HDC hdc, int width, int height, int step) {
|
||||
for (int i = 0; i <= width; i = i + step) {
|
||||
MoveToEx(hdc, i, 0, NULL);
|
||||
LineTo(hdc, i, height);
|
||||
}
|
||||
|
||||
for (int i = 0; i <= height; i = i + step) {
|
||||
MoveToEx(hdc, 0, i, NULL);
|
||||
LineTo(hdc, width, i);
|
||||
}
|
||||
}
|
||||
|
||||
void drawImage1(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 4, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[4] = {
|
||||
cx, cy - 20,
|
||||
cx + 20, cy + 20,
|
||||
cx - 20, cy + 20,
|
||||
cx, cy - 20
|
||||
};
|
||||
Polyline(hdc, p, 4);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawImage2(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 4, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[5] = {
|
||||
cx, cy - 20,
|
||||
cx + 20, cy,
|
||||
cx, cy + 20,
|
||||
cx - 20, cy,
|
||||
cx, cy - 20
|
||||
};
|
||||
Polyline(hdc, p, 5);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawImage3(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 1, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[5] = {
|
||||
cx, cy,
|
||||
cx + 20, cy - 20,
|
||||
cx, cy + 20,
|
||||
cx - 20, cy - 20,
|
||||
cx, cy
|
||||
};
|
||||
Polyline(hdc, p, 5);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
struct Image {
|
||||
int x;
|
||||
int y;
|
||||
int vx;
|
||||
int vy;
|
||||
COLORREF color;
|
||||
};
|
||||
struct Image im1 = { 100, 100, 10, 10, RGB(200, 100, 128) };
|
||||
struct Image im2 = { 400, 100, -10, -10, RGB(100, 200, 128) };
|
||||
|
||||
#define IMG3NUM 8
|
||||
struct Image im3[IMG3NUM] = {
|
||||
{ 300, 100, 8, 10, RGB(150, 150, 220) },
|
||||
{ 300, 100, -4, 7, RGB(150, 150, 220) },
|
||||
{ 300, 100, -4, -11, RGB(150, 150, 220) },
|
||||
{ 300, 100, 3, 15, RGB(150, 150, 220) },
|
||||
{ 300, 100, 14, 7, RGB(150, 150, 220) },
|
||||
{ 300, 100, -10, 10, RGB(150, 150, 220) },
|
||||
{ 300, 100, 5, -10, RGB(150, 150, 220) },
|
||||
{ 300, 100, -10, -7, RGB(150, 150, 220) },
|
||||
};
|
||||
|
||||
void bounce(RECT rect, struct Image* pim) {
|
||||
if ((*pim).y >= rect.bottom and (*pim).vy > 0) {
|
||||
(*pim).vy = -(*pim).vy;
|
||||
(*pim).y = rect.bottom;
|
||||
}
|
||||
if ((*pim).y < rect.top + 1) {
|
||||
(*pim).vy = -(*pim).vy;
|
||||
(*pim).y = rect.top;
|
||||
}
|
||||
if ((*pim).x > rect.right - 1) {
|
||||
(*pim).vx = -(*pim).vx;
|
||||
(*pim).x = rect.right;
|
||||
}
|
||||
if ((*pim).x < rect.left + 1) {
|
||||
(*pim).vx = -(*pim).vx;
|
||||
(*pim).x = rect.left;
|
||||
}
|
||||
}
|
||||
|
||||
//void bounce(RECT rect, struct Image* pim) {
|
||||
// if ((*pim).y > rect.bottom - 1) {
|
||||
// (*pim).vy = -(*pim).vy;
|
||||
// (*pim).y = rect.bottom;
|
||||
// }
|
||||
// if ((*pim).y < rect.top + 1) {
|
||||
// (*pim).vy = -(*pim).vy;
|
||||
// (*pim).y = rect.top;
|
||||
// }
|
||||
// if ((*pim).x > rect.right - 1) {
|
||||
// (*pim).vx = -(*pim).vx;
|
||||
// (*pim).x = rect.right;
|
||||
// }
|
||||
// if ((*pim).x < rect.left + 1) {
|
||||
// (*pim).vx = -(*pim).vx;
|
||||
// (*pim).x = rect.left;
|
||||
// }
|
||||
//}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
//
|
||||
// ЦЕЛЬ: Обрабатывает сообщения в главном окне.
|
||||
//
|
||||
// WM_COMMAND - обработать меню приложения
|
||||
// WM_PAINT - Отрисовка главного окна
|
||||
// WM_DESTROY - отправить сообщение о выходе и вернуться
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
{
|
||||
int wmId = LOWORD(wParam);
|
||||
// Разобрать выбор в меню:
|
||||
switch (wmId)
|
||||
{
|
||||
case IDM_ABOUT:
|
||||
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
|
||||
break;
|
||||
case IDM_EXIT:
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_CREATE:
|
||||
{
|
||||
SetTimer(hWnd, 1, 100, 0);
|
||||
}
|
||||
break;
|
||||
case WM_TIMER:
|
||||
{
|
||||
im1.x += im1.vx; im1.y += im1.vy;
|
||||
im2.x += im2.vx; im2.y += im2.vy;
|
||||
for (int i = 0; i < IMG3NUM; i++) {
|
||||
im3[i].x += im3[i].vx; im3[i].y += im3[i].vy;
|
||||
}
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
}
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hWnd, &ps);
|
||||
// TODO: Добавьте сюда любой код прорисовки, использующий HDC...
|
||||
|
||||
RECT rect;
|
||||
GetClientRect(hWnd, &rect);
|
||||
drawNet(hdc, rect.right, rect.bottom, 50);
|
||||
|
||||
bounce(rect, &im1);
|
||||
bounce(rect, &im2);
|
||||
for (int i = 0; i < IMG3NUM; i++) {
|
||||
bounce(rect, &im3[i]);
|
||||
}
|
||||
|
||||
drawImage1(hdc, im1.x, im1.y, im1.color);
|
||||
drawImage2(hdc, im2.x, im2.y, im2.color);
|
||||
for (int i = 0; i < IMG3NUM; i++) {
|
||||
drawImage3(hdc, im3[i].x, im3[i].y, im3[i].color);
|
||||
}
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Обработчик сообщений для окна "О программе".
|
||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return (INT_PTR)TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
}
|
3
lab12/lab12/lab12.h
Normal file
@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
BIN
lab12/lab12/lab12.ico
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
lab12/lab12/lab12.rc
Normal file
148
lab12/lab12/lab12.vcxproj
Normal file
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{45c15208-08c4-4b71-a4d6-b58edc8da968}</ProjectGuid>
|
||||
<RootNamespace>lab12</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="lab12.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab12.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="lab12.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="lab12.ico" />
|
||||
<Image Include="small.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
49
lab12/lab12/lab12.vcxproj.filters
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lab12.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab12.cpp">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="lab12.rc">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="small.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
<Image Include="lab12.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
BIN
lab12/lab12/small.ico
Normal file
After Width: | Height: | Size: 45 KiB |
6
lab12/lab12/targetver.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// // При включении SDKDDKVer.h будет задана самая новая из доступных платформ Windows.
|
||||
// Если вы планируете сборку приложения для предыдущей версии платформы Windows, включите WinSDKVer.h и
|
||||
// задайте желаемую платформу в макросе _WIN32_WINNT, прежде чем включать SDKDDKVer.h.
|
||||
#include <SDKDDKVer.h>
|
BIN
lab13/diagram (1).png
Normal file
After Width: | Height: | Size: 64 KiB |
31
lab13/lab13.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34616.47
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab13", "lab13\lab13.vcxproj", "{20A86935-1CE2-4A60-8957-361F97CB04AA}"
|
||||
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
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Debug|x64.Build.0 = Debug|x64
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Debug|x86.Build.0 = Debug|Win32
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Release|x64.ActiveCfg = Release|x64
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Release|x64.Build.0 = Release|x64
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Release|x86.ActiveCfg = Release|Win32
|
||||
{20A86935-1CE2-4A60-8957-361F97CB04AA}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {DFB6070D-DF56-4483-A5CE-F17539C2A338}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
135
lab13/lab13/lab13.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{20a86935-1ce2-4a60-8957-361f97cb04aa}</ProjectGuid>
|
||||
<RootNamespace>lab13</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
lab13/lab13/lab13.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
187
lab13/lab13/main.c
Normal file
@ -0,0 +1,187 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
void arrayinput(int arr[], int len) {
|
||||
printf("Ââĺäčňĺ %d ýëĺěĺíňîâ ěŕńńčâŕ\n", len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
scanf_s(" %d", &arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void printarr(int arr[], int len) {
|
||||
printf("Ńîäĺđćčěîĺ ěŕńńčâŕ: [");
|
||||
for (int i = 0; i < len; i++) {
|
||||
printf("%d, ", arr[i]);
|
||||
}
|
||||
printf("\b\b]\n");
|
||||
}
|
||||
|
||||
void odds10x(int arr[], int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (arr[i] % 2 != 0) arr[i] *= 10;
|
||||
}
|
||||
}
|
||||
|
||||
void lasteven2x(int arr[], int len) {
|
||||
for (int i = len - 1; i > 0; i--) {
|
||||
if (arr[i] % 2 == 0) {
|
||||
arr[i] *= 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int index(int num, int arr[], int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (arr[i] == num) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int arrmax(int arr[], int len) {
|
||||
int max = arr[0];
|
||||
for (int i = 1; i < len; i++) {
|
||||
if (arr[i] > max) max = arr[i];
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
int arrmin(int arr[], int len) {
|
||||
int min = arr[0];
|
||||
for (int i = 1; i < len; i++) {
|
||||
if (arr[i] < min) min = arr[i];
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
void switchmaxmin(int arr[], int len) {
|
||||
int tmpmax = arrmax(arr, len);
|
||||
int tmpmin = arrmin(arr, len);
|
||||
int maxi = index(tmpmax, arr, len);
|
||||
int mini = index(tmpmin, arr, len);
|
||||
arr[maxi] = tmpmin;
|
||||
arr[mini] = tmpmax;
|
||||
}
|
||||
|
||||
void evenleftmin(int arr[], int len) {
|
||||
int id = index(arrmin(arr, len), arr, len);
|
||||
int count = 0;
|
||||
for (int i = 0; i < id; i++) {
|
||||
if (arr[i] % 2 == 0) count++;
|
||||
}
|
||||
printf("×čńëî ÷ĺňíűő ëĺâĺĺ ěčíčěŕëüíîăî = %d\n", count);
|
||||
}
|
||||
|
||||
void negeven(int arr[], int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (arr[i] % 2 == 0) arr[i] *= -1;
|
||||
}
|
||||
}
|
||||
|
||||
void replace4(int arr[], int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (arr[i] < 4) arr[i] = 4;
|
||||
}
|
||||
}
|
||||
|
||||
void replacemax0(int arr[], int len) {
|
||||
int maxi = index(arrmax(arr, len), arr, len);
|
||||
for (int i = maxi; i < len; i++) {
|
||||
if (arr[i] % 2 != 0) arr[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void muleveneven(int arr[], int len) {
|
||||
int even1 = 0;
|
||||
int even2 = len - 1;
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (arr[i] % 2 == 0) {
|
||||
even1 = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = len - 1; i > 0; i--) {
|
||||
if (arr[i] % 2 == 0) {
|
||||
even2 = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = even1; i < even2; i++) {
|
||||
arr[i] *= 100;
|
||||
}
|
||||
}
|
||||
|
||||
#define ARRNUM 10
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int arr[ARRNUM] = {5, 7, 12, 3, 4, 8, -1, 6, 1, 7};
|
||||
/*for (int i = 0; i < ARRNUM; i++) {
|
||||
arr[i] = 0;
|
||||
}*/
|
||||
|
||||
int n = -1;
|
||||
do {
|
||||
puts("\n");
|
||||
printarr(arr, ARRNUM);
|
||||
puts("Âűáĺđčňĺ ďđîăđŕěěó");
|
||||
puts("1) Ââĺńňč ÷čńëŕ â ěŕńńčâ");
|
||||
puts("2) Óěíîćčňü íĺ÷¸ňíűĺ ÷čńëŕ íŕ 10");
|
||||
puts("3) Óěíîćčňü ďîńëĺäíĺĺ ÷¸ňíîĺ ÷čńëî íŕ 2");
|
||||
puts("4) Ńęîëüęî ÷ĺňíűő ëĺâĺĺ ěčíčěŕëüíîăî");
|
||||
puts("6) Ďîěĺí˙ňü ěŕęń č ěčí ěĺńňŕěč");
|
||||
puts("7) Âńĺ ÷ĺňíűĺ ýëĺěĺíňű ěŕńńčâŕ óěíîćčňü íŕ -1");
|
||||
puts("8) Âńĺ ýëĺěĺíňű ěŕńńčâŕ čěĺţůčĺ çíŕ÷ĺíč˙ ěĺíüřĺ 4 çŕěĺíčňü íŕ 4");
|
||||
puts("9) Âńĺ íĺ÷ĺňíűĺ ýëĺěĺíňű, ńňî˙ůčĺ ďîńëĺ ěŕęńčěŕëüíîăî, çŕěĺíčňü íŕ 0");
|
||||
puts("11) Âńĺ ýëĺěĺíňű ěĺćäó ďĺđâűě č ďîńëĺäíčě ÷ĺňíűě óâĺëč÷čňü â 100 đŕç");
|
||||
puts("");
|
||||
puts("0) exit program");
|
||||
|
||||
while (scanf_s(" %d", &n) != 1) {
|
||||
scanf_s("%*[^\n]");
|
||||
scanf_s("%*c");
|
||||
}
|
||||
puts("");
|
||||
|
||||
switch (n)
|
||||
{
|
||||
case 1:
|
||||
arrayinput(arr, ARRNUM);
|
||||
break;
|
||||
case 2:
|
||||
odds10x(arr, ARRNUM);
|
||||
break;
|
||||
case 3:
|
||||
lasteven2x(arr, ARRNUM);
|
||||
break;
|
||||
case 4:
|
||||
evenleftmin(arr, ARRNUM);
|
||||
break;
|
||||
case 6:
|
||||
switchmaxmin(arr, ARRNUM);
|
||||
break;
|
||||
case 7:
|
||||
negeven(arr, ARRNUM);
|
||||
break;
|
||||
case 8:
|
||||
replace4(arr, ARRNUM);
|
||||
break;
|
||||
case 9:
|
||||
replacemax0(arr, ARRNUM);
|
||||
break;
|
||||
case 11:
|
||||
muleveneven(arr, ARRNUM);
|
||||
break;
|
||||
case 0:
|
||||
puts("goodbye :3");
|
||||
break;
|
||||
default:
|
||||
puts("error: wrong N");
|
||||
break;
|
||||
}
|
||||
|
||||
} while (n != 0);
|
||||
return 0;
|
||||
}
|
1
lab14/diagram.json
Normal file
@ -0,0 +1 @@
|
||||
{"blocks":[{"x":550,"y":280,"text":"начало","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":360,"text":"int i = *len","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":555,"y":230,"text":"insert(int num, int index, int arr[], int* len)","width":270,"height":20,"type":"Текст / комментарий","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"left","labelsPosition":1},{"x":550,"y":450,"text":"i > index","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":530,"text":"arr[i] = arr[i-1]","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":620,"text":"*len += 1\narr[index] = num","width":120,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":710,"text":"конец","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1}],"arrows":[{"startIndex":0,"endIndex":1,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":295},{"x":550,"y":320},{"x":550,"y":340}],"counts":[1,1,1]},{"startIndex":1,"endIndex":3,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":380},{"x":550,"y":410},{"x":550,"y":430}],"counts":[1,1,1]},{"startIndex":3,"endIndex":4,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":470},{"x":550,"y":490},{"x":550,"y":510}],"counts":[1,1,1]},{"startIndex":4,"endIndex":3,"startConnectorIndex":1,"endConnectorIndex":0,"nodes":[{"x":600,"y":530},{"x":630,"y":530},{"x":630,"y":410},{"x":550,"y":410},{"x":550,"y":430}],"counts":[1,1,1,1,1]},{"startIndex":3,"endIndex":5,"startConnectorIndex":3,"endConnectorIndex":0,"nodes":[{"x":500,"y":450},{"x":480,"y":450},{"x":480,"y":580},{"x":550,"y":580},{"x":550,"y":600}],"counts":[1,1,1,1,1]},{"startIndex":5,"endIndex":6,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":640},{"x":550,"y":680},{"x":550,"y":695}],"counts":[1,1,1]}],"x0":-1046.0499999999997,"y0":-1083.4740506757412}
|
BIN
lab14/diagram.png
Normal file
After Width: | Height: | Size: 82 KiB |
31
lab14/lab14.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab14", "lab14\lab14.vcxproj", "{976C8B3E-9653-472C-94F9-13C7C59A4371}"
|
||||
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
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Debug|x64.Build.0 = Debug|x64
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Debug|x86.Build.0 = Debug|Win32
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Release|x64.ActiveCfg = Release|x64
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Release|x64.Build.0 = Release|x64
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Release|x86.ActiveCfg = Release|Win32
|
||||
{976C8B3E-9653-472C-94F9-13C7C59A4371}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A3E1F839-2D3D-4D5A-A443-E711427189C6}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
135
lab14/lab14/lab14.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{976c8b3e-9653-472c-94f9-13c7c59a4371}</ProjectGuid>
|
||||
<RootNamespace>lab14</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
lab14/lab14/lab14.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
214
lab14/lab14/main.c
Normal file
@ -0,0 +1,214 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
|
||||
int index(int num, int arr[], int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (arr[i] == num) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int count(int num, int arr[], int len) {
|
||||
int count = 0;
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (arr[i] == num) count += 1;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int arrmax(int arr[], int len) {
|
||||
int max = arr[0];
|
||||
for (int i = 1; i < len; i++) {
|
||||
if (arr[i] > max) max = arr[i];
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
int arrmin(int arr[], int len) {
|
||||
int min = arr[0];
|
||||
for (int i = 1; i < len; i++) {
|
||||
if (arr[i] < min) min = arr[i];
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
void printarr(int arr[], int len) {
|
||||
printf("[");
|
||||
for (int i = 0; i < len; i++) {
|
||||
printf("%d, ", arr[i]);
|
||||
}
|
||||
printf("\b\b]\n");
|
||||
}
|
||||
|
||||
void deleteindex(int index, int arr[], int* len) {
|
||||
arr[index] = 0;
|
||||
for (int i = index; i < *len - 1; i++) {
|
||||
arr[i] = arr[i + 1];
|
||||
}
|
||||
*len -= 1;
|
||||
}
|
||||
|
||||
void insert(int num, int index, int arr[], int* len) {
|
||||
for (int i = *len; i > index; i--) {
|
||||
arr[i] = arr[i - 1];
|
||||
}
|
||||
*len += 1;
|
||||
arr[index] = num;
|
||||
}
|
||||
|
||||
void deletemax3(int arr[], int* len) {
|
||||
int max = arr[0];
|
||||
int maxi = 0;
|
||||
for (int i = 1; i < *len; i++) {
|
||||
if (arr[i] > max && arr[i] % 3 == 0) {
|
||||
max = arr[i];
|
||||
maxi = i;
|
||||
}
|
||||
}
|
||||
deleteindex(maxi, arr, len);
|
||||
}
|
||||
|
||||
exchange_max_chains(int A[], int B[], int* sA, int* sB) {
|
||||
int a = A[0], sa = 1, ai = 0;
|
||||
int b = B[0], sb = 1, bi = 0;
|
||||
int ts = 1;
|
||||
for (int i = 0; i < *sA - 1; i++) {
|
||||
if (A[i] == A[i + 1]) {
|
||||
ts += 1;
|
||||
}
|
||||
else if (ts > sa) {
|
||||
sa = ts;
|
||||
ai = i + 1 - sa;
|
||||
ts = 1;
|
||||
a = A[i];
|
||||
}
|
||||
}
|
||||
ts = 1;
|
||||
for (int i = 0; i < *sB - 1; i++) {
|
||||
if (B[i] == B[i + 1]) {
|
||||
ts += 1;
|
||||
}
|
||||
else if (ts > sb) {
|
||||
sb = ts;
|
||||
bi = i + 1 - sb;
|
||||
ts = 1;
|
||||
b = B[i];
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < sa; i++) {
|
||||
deleteindex(ai, A, sA);
|
||||
}
|
||||
for (int i = 0; i < sb; i++) {
|
||||
insert(b, ai, A, sA);
|
||||
}
|
||||
for (int i = 0; i < sb; i++) {
|
||||
deleteindex(bi, B, sB);
|
||||
}
|
||||
for (int i = 0; i < sa; i++) {
|
||||
insert(a, bi, B, sB);
|
||||
}
|
||||
printf("A: %d %d %d\n", a, sa, ai);
|
||||
printf("B: %d %d %d\n", b, sb, bi);
|
||||
printf("A = ");
|
||||
printarr(A, *sA);
|
||||
printf("B = ");
|
||||
printarr(B, *sB);
|
||||
}
|
||||
|
||||
//#define ARRLEN 10
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int arr[20] = { 3, 7, 12, 3, 4, 8, -1, 6, 1, 7 };
|
||||
int size = 10;
|
||||
int A[20] = {3, 2, 2, 5, 2, 1, 1, 1, 3, 9};
|
||||
int sA = 10;
|
||||
int B[20] = {1, 2, 5, 5, 4, 8, 3, 3};
|
||||
int sB = 8;
|
||||
int id, val;
|
||||
|
||||
int n = 0;
|
||||
do {
|
||||
puts("\n");
|
||||
printf("Ñîäåðæèìîå ìàññèâà : ");
|
||||
printarr(arr, size);
|
||||
puts("Âûáåðèòå ïðîãðàììó");
|
||||
puts("1) Óäàëèòü ýëåìåíò ïî èíäåêñó");
|
||||
puts("2) Âñòàâèòü ýëåìåíò ïî èíäåêñó");
|
||||
puts("3) Óäàëèòü ìèíèìàëüíûé ýëåìåíò");
|
||||
puts("4) Ïåðåä ìèíèìàëüíûì ýëåìåíòîì âñòàâèòü 0");
|
||||
puts("5) Óäàëèòü âñå ÷¸òíûå ýëåìåíòû");
|
||||
puts("6) Äóáëèðîâàòü âñå ÷¸òíûå ýëåìåíòû");
|
||||
puts("99) Óäàëèòü ìàêñèìàëüíûé ýëåìåíò êðàòíûé òð¸ì");
|
||||
puts("10) Óäàëèòü ýëåìåíòû, âñòðå÷àþùèåñÿ â ìàññèâå òîëüêî îäèí ðàç");
|
||||
puts("11) Ìåæäó ìàññèâàìè A è B îáìåíÿòü èõ ñàìûå äëèííûå öåïî÷êè èç îäèíàêîâûõ ýëåìåíòîâ");
|
||||
puts("");
|
||||
puts("0) exit program");
|
||||
|
||||
while (scanf_s(" %d", &n) != 1) {
|
||||
scanf_s("%*[^\n]");
|
||||
scanf_s("%*c");
|
||||
}
|
||||
puts("");
|
||||
|
||||
switch (n)
|
||||
{
|
||||
case 1:
|
||||
printf("delete index = ");
|
||||
scanf_s("%d", &id);
|
||||
deleteindex(id, arr, &size);
|
||||
break;
|
||||
case 2:
|
||||
printf("value = ");
|
||||
scanf_s("%d", &val);
|
||||
printf("index = ");
|
||||
scanf_s("%d", &id);
|
||||
insert(val, id, arr, &size);
|
||||
break;
|
||||
case 3:
|
||||
deleteindex(index(arrmin(arr, size), arr, size), arr, &size);
|
||||
break;
|
||||
case 4:
|
||||
insert(0, index(arrmin(arr, size), arr, size), arr, &size);
|
||||
break;
|
||||
case 5:
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (arr[i] % 2 == 0) deleteindex(i, arr, &size);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (arr[i] % 2 == 0) {
|
||||
insert(arr[i], i, arr, &size);
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 99:
|
||||
deletemax3(arr, &size);
|
||||
break;
|
||||
case 10:
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (count(arr[i], arr, size) == 1) {
|
||||
deleteindex(index(arr[i], arr, size), arr, &size);
|
||||
i -= 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
exchange_max_chains(A, B, &sA, &sB);
|
||||
break;
|
||||
case 0:
|
||||
puts("goodbye :3");
|
||||
break;
|
||||
default:
|
||||
puts("error: wrong N");
|
||||
break;
|
||||
}
|
||||
|
||||
} while (n != 0);
|
||||
return 0;
|
||||
}
|
31
lab2/lab2.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab2", "lab2\lab2.vcxproj", "{C3B50AE8-C4ED-4032-9919-A738A69F3D48}"
|
||||
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
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Debug|x64.Build.0 = Debug|x64
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Debug|x86.Build.0 = Debug|Win32
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Release|x64.ActiveCfg = Release|x64
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Release|x64.Build.0 = Release|x64
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Release|x86.ActiveCfg = Release|Win32
|
||||
{C3B50AE8-C4ED-4032-9919-A738A69F3D48}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E8F9B036-CAEF-4037-A891-A507AB3EE22A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
136
lab2/lab2/lab2.vcxproj
Normal file
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{c3b50ae8-c4ed-4032-9919-a738a69f3d48}</ProjectGuid>
|
||||
<RootNamespace>lab2</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard_C>Default</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
lab2/lab2/lab2.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
73
lab2/lab2/main.c
Normal file
@ -0,0 +1,73 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <Windows.h>
|
||||
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
void vector_angle() {
|
||||
float x1, y1, x2, y2;
|
||||
printf("Ââåäèòå êîîðäèíàòû âåêòîðîâ\n");
|
||||
printf("x1 = ");
|
||||
scanf_s("%f", &x1);
|
||||
printf("y1 = ");
|
||||
scanf_s("%f", &y1);
|
||||
printf("x2 = ");
|
||||
scanf_s("%f", &x2);
|
||||
printf("y2 = ");
|
||||
scanf_s("%f", &y2);
|
||||
printf("%.2f ãðàäóñîâ", 57.3 * acos((x1 * x2 + y1 * y2) / (sqrt(x1 * x1 + y1 * y1) * sqrt(x2 * x2 + y2 * y2))));
|
||||
}
|
||||
|
||||
void lc_freq() {
|
||||
float L, C;
|
||||
printf("L = ");
|
||||
scanf_s("%f", &L);
|
||||
printf("C = ");
|
||||
scanf_s("%f", &C);
|
||||
printf("%.2f Ãö", 1 / (2 * PI * sqrt(L * C)));
|
||||
}
|
||||
|
||||
void deposit() {
|
||||
int money, days;
|
||||
float rate, eff, result;
|
||||
printf("ñòàâêà â %% = ");
|
||||
scanf_s("%f", &rate);
|
||||
printf("ñóììà äåïîçèòà = ");
|
||||
scanf_s("%d", &money);
|
||||
printf("ñêîëüêî äíåé êàïèòàëèçàöèè â ãîä = ");
|
||||
scanf_s("%d", &days);
|
||||
result = money * pow((1 + (rate / 100) / days), days);
|
||||
eff = (result - money) / money * 100;
|
||||
printf("ýôôåêòèâíàÿ ñòàâêà = %.2f%% äîõîä = %.2f", eff, result - money);
|
||||
}
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int num;
|
||||
printf("1. Ðàññ÷èòàòü óãîë ìåæäó äâóìÿ äâóõìåðíûìè âåêòîðàìè.\n");
|
||||
printf("2. Ðàññ÷èòàòü ðåçîíàíñíóþ ÷àñòîòó LC-êîíòóðà.\n");
|
||||
printf("3. Ðàññ÷èòàòü äîõîä ïî âêëàäó çà ãîä.\n");
|
||||
|
||||
printf("Âûáåðèòå ïðîãðàììó: ");
|
||||
scanf_s("%d", &num);
|
||||
|
||||
switch (num)
|
||||
{
|
||||
case 1:
|
||||
vector_angle();
|
||||
break;
|
||||
case 2:
|
||||
lc_freq();
|
||||
break;
|
||||
case 3:
|
||||
deposit();
|
||||
break;
|
||||
default:
|
||||
printf("Íå òîò íîìåð!");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
BIN
lab3/diagram.zip
Normal file
20
lab3/lab3-3/lab3-3.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int t;
|
||||
printf("òåìïåðàòóðà = ");
|
||||
scanf_s("%d", &t);
|
||||
|
||||
if (t < 18) printf("õîëîäíî");
|
||||
else if (t < 22) printf("ïðîõëàäíî");
|
||||
else if (t < 26) printf("òåïëî");
|
||||
else printf("æàðêî");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
135
lab3/lab3-3/lab3-3.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-3.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{6b79783f-be5a-40d9-9f98-f94a6b5b3c28}</ProjectGuid>
|
||||
<RootNamespace>lab33</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
lab3/lab3-3/lab3-3.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-3.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
23
lab3/lab3-4/lab3-4.c
Normal file
@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main() {
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int nums[5];
|
||||
int max;
|
||||
|
||||
printf("ââåäèòå 5 öåëûõ ÷èñåë: ");
|
||||
scanf_s("%d%d%d%d%d", &nums[0], &nums[1], &nums[2], &nums[3], &nums[4]);
|
||||
|
||||
max = nums[0];
|
||||
|
||||
for (int i = 1; i < 5; i++) {
|
||||
if (nums[i] > max) max = nums[i];
|
||||
}
|
||||
|
||||
printf("max = %d", max);
|
||||
|
||||
return 0;
|
||||
}
|
135
lab3/lab3-4/lab3-4.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-4.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{d6687108-4ab6-4fe0-ac6a-53b3f086b122}</ProjectGuid>
|
||||
<RootNamespace>lab34</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
lab3/lab3-4/lab3-4.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-4.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
22
lab3/lab3-7/lab3-7.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int v;
|
||||
printf("ñêîðîñòü ñàìîë¸òà â êì/÷ = ");
|
||||
scanf_s("%d", &v);
|
||||
|
||||
if (v > 3000) puts("ìãíîâåííî");
|
||||
else if (v > 1200) puts("î÷åíü áûñòðî");
|
||||
else if (v > 800) puts("áûñòðî");
|
||||
else if (v > 500) puts("íîðìàëüíî");
|
||||
else if (v > 200) puts("ìåäëåííî");
|
||||
else puts("î÷åíü ìåäëåííî");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
1
lab3/lab3-7/lab3-7.json
Normal file
BIN
lab3/lab3-7/lab3-7.png
Normal file
After Width: | Height: | Size: 120 KiB |
138
lab3/lab3-7/lab3-7.vcxproj
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-7.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="lab3-7.png" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{48ffe418-4e2d-41c5-b633-dca05192633f}</ProjectGuid>
|
||||
<RootNamespace>lab37</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
27
lab3/lab3-7/lab3-7.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-7.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="lab3-7.png">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
61
lab3/lab3.sln
Normal file
@ -0,0 +1,61 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab3-2", "lab3\lab3.vcxproj", "{56F44A0E-5D48-4515-957B-D1AB4761983D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab3-3", "lab3-3\lab3-3.vcxproj", "{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab3-4", "lab3-4\lab3-4.vcxproj", "{D6687108-4AB6-4FE0-AC6A-53B3F086B122}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab3-7", "lab3-7\lab3-7.vcxproj", "{48FFE418-4E2D-41C5-B633-DCA05192633F}"
|
||||
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
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Debug|x64.Build.0 = Debug|x64
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Debug|x86.Build.0 = Debug|Win32
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Release|x64.ActiveCfg = Release|x64
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Release|x64.Build.0 = Release|x64
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Release|x86.ActiveCfg = Release|Win32
|
||||
{56F44A0E-5D48-4515-957B-D1AB4761983D}.Release|x86.Build.0 = Release|Win32
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Debug|x64.Build.0 = Debug|x64
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Release|x64.ActiveCfg = Release|x64
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Release|x64.Build.0 = Release|x64
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6B79783F-BE5A-40D9-9F98-F94A6B5B3C28}.Release|x86.Build.0 = Release|Win32
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Debug|x64.Build.0 = Debug|x64
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Release|x64.ActiveCfg = Release|x64
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Release|x64.Build.0 = Release|x64
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D6687108-4AB6-4FE0-AC6A-53B3F086B122}.Release|x86.Build.0 = Release|Win32
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Debug|x64.Build.0 = Debug|x64
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Debug|x86.Build.0 = Debug|Win32
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Release|x64.ActiveCfg = Release|x64
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Release|x64.Build.0 = Release|x64
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Release|x86.ActiveCfg = Release|Win32
|
||||
{48FFE418-4E2D-41C5-B633-DCA05192633F}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C95E619B-76BD-488C-B621-C5B0A2A59300}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
26
lab3/lab3/lab3-2.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main() {
|
||||
int max, v1, v2, v3;
|
||||
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
printf("ââåäèòå 3 öåëûõ ÷èñëà: ");
|
||||
scanf_s("%d%d%d", &v1, &v2, &v3);
|
||||
max = v1;
|
||||
|
||||
if (v2 > max) {
|
||||
max = v2;
|
||||
}
|
||||
|
||||
if (v3 > max) {
|
||||
max = v3;
|
||||
}
|
||||
|
||||
printf("max = %d", max);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
1
lab3/lab3/lab3-2.json
Normal file
@ -0,0 +1 @@
|
||||
{"blocks":[{"x":550,"y":30,"text":"max = v1","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":120,"text":"v2 > max","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":240,"text":"max = v3","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":340,"text":"вывод max","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":-60,"text":"ввод v1, v2, v3","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":-150,"text":"начало","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":440,"text":"конец","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":555,"y":-190,"text":"lab3-2","width":70,"height":40,"type":"Текст / комментарий","isMenuBlock":false,"fontSize":22,"textHeight":22,"isBold":true,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":700,"y":120,"text":"max = v2","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":700,"y":240,"text":"max = v3","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1}],"arrows":[{"startIndex":5,"endIndex":4,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":-135},{"x":550,"y":-100},{"x":550,"y":-80}],"counts":[1,1,1]},{"startIndex":4,"endIndex":0,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":-40},{"x":550,"y":-10},{"x":550,"y":10}],"counts":[1,1,1]},{"startIndex":1,"endIndex":8,"startConnectorIndex":1,"endConnectorIndex":3,"nodes":[{"x":600,"y":120},{"x":630,"y":120},{"x":650,"y":120}],"counts":[1,1,1]},{"startIndex":2,"endIndex":9,"startConnectorIndex":1,"endConnectorIndex":3,"nodes":[{"x":600,"y":240},{"x":630,"y":240},{"x":650,"y":240}],"counts":[1,1,1]},{"startIndex":0,"endIndex":1,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":50},{"x":550,"y":80},{"x":550,"y":100}],"counts":[1,1,1]},{"startIndex":3,"endIndex":6,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":360},{"x":550,"y":410},{"x":550,"y":425}],"counts":[1,1,1]},{"startIndex":1,"endIndex":2,"startConnectorIndex":3,"endConnectorIndex":0,"nodes":[{"x":500,"y":120},{"x":480,"y":120},{"x":480,"y":180},{"x":550,"y":180},{"x":550,"y":220}],"counts":[1,1,1,1,1]},{"startIndex":2,"endIndex":3,"startConnectorIndex":3,"endConnectorIndex":0,"nodes":[{"x":500,"y":240},{"x":480,"y":240},{"x":480,"y":280},{"x":550,"y":280},{"x":550,"y":320}],"counts":[1,1,1,1,1]},{"startIndex":9,"endIndex":3,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":700,"y":260},{"x":700,"y":280},{"x":550,"y":280},{"x":550,"y":320}],"counts":[1,1,1,1]},{"startIndex":8,"endIndex":2,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":700,"y":140},{"x":700,"y":180},{"x":550,"y":180},{"x":550,"y":220}],"counts":[1,1,1,1]}],"x0":-150.80208333333348,"y0":298.41666666666674}
|
BIN
lab3/lab3/lab3-2.png
Normal file
After Width: | Height: | Size: 93 KiB |
139
lab3/lab3/lab3.vcxproj
Normal file
@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-2.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="lab3-2.png" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{56f44a0e-5d48-4515-957b-d1ab4761983d}</ProjectGuid>
|
||||
<RootNamespace>lab3</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>lab3-2</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
27
lab3/lab3/lab3.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab3-2.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="lab3-2.png">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
1
lab4/lab4-1/diagram.json
Normal file
@ -0,0 +1 @@
|
||||
{"blocks":[{"x":550,"y":20,"text":"ввод n","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":100,"text":"i = 1","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":200,"text":"вывод i","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":290,"text":"i = i +1","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":380,"text":"i ≤ n","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":490,"text":"конец","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":-50,"text":"начало","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1}],"arrows":[{"startIndex":1,"endIndex":2,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":120},{"x":550,"y":160},{"x":550,"y":180}],"counts":[1,1,1]},{"startIndex":2,"endIndex":3,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":220},{"x":550,"y":250},{"x":550,"y":270}],"counts":[1,1,1]},{"startIndex":3,"endIndex":4,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":310},{"x":550,"y":340},{"x":550,"y":360}],"counts":[1,1,1]},{"startIndex":4,"endIndex":2,"startConnectorIndex":1,"endConnectorIndex":0,"nodes":[{"x":600,"y":380},{"x":650,"y":380},{"x":650,"y":160},{"x":550,"y":160},{"x":550,"y":180}],"counts":[1,1,1,1,1]},{"startIndex":6,"endIndex":0,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":-35},{"x":550,"y":-20},{"x":550,"y":0}],"counts":[1,1,1]},{"startIndex":0,"endIndex":1,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":40},{"x":550,"y":60},{"x":550,"y":80}],"counts":[1,1,1]},{"startIndex":4,"endIndex":5,"startConnectorIndex":3,"endConnectorIndex":0,"nodes":[{"x":500,"y":380},{"x":480,"y":380},{"x":480,"y":440},{"x":550,"y":440},{"x":550,"y":475}],"counts":[1,1,1,1,1]}],"x0":-942.924999999999,"y0":-318.39999999999884}
|
BIN
lab4/lab4-1/diagram.png
Normal file
After Width: | Height: | Size: 60 KiB |
21
lab4/lab4-1/lab4-1.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int n;
|
||||
printf("n = ");
|
||||
scanf_s("%d", &n);
|
||||
|
||||
int i = 1;
|
||||
do {
|
||||
printf("%d ", i);
|
||||
i += 1;
|
||||
} while (i <= n);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
138
lab4/lab4-1/lab4-1.vcxproj
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{d70249db-8680-4d0a-83c4-d7fa9ae642d3}</ProjectGuid>
|
||||
<RootNamespace>lab41</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-1.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="diagram.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
27
lab4/lab4-1/lab4-1.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-1.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="diagram.png">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
1
lab4/lab4-2/diagram.json
Normal file
@ -0,0 +1 @@
|
||||
{"blocks":[{"x":550,"y":20,"text":"ввод n","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":490,"text":"конец","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":-50,"text":"начало","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":110,"text":"i = 1\nstep = 0","width":100,"height":60,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":200,"text":"вывод\n\"2^{step} = {i}\\n\"","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":290,"text":"i = i * 2\nstep += 1","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":380,"text":"step ≤ n","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1}],"arrows":[{"startIndex":3,"endIndex":4,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":140},{"x":550,"y":160},{"x":550,"y":180}],"counts":[1,1,1]},{"startIndex":4,"endIndex":5,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":220},{"x":550,"y":250},{"x":550,"y":270}],"counts":[1,1,1]},{"startIndex":5,"endIndex":6,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":310},{"x":550,"y":340},{"x":550,"y":360}],"counts":[1,1,1]},{"startIndex":6,"endIndex":4,"startConnectorIndex":1,"endConnectorIndex":0,"nodes":[{"x":600,"y":380},{"x":650,"y":380},{"x":650,"y":160},{"x":550,"y":160},{"x":550,"y":180}],"counts":[1,1,1,1,1]},{"startIndex":2,"endIndex":0,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":-35},{"x":550,"y":-20},{"x":550,"y":0}],"counts":[1,1,1]},{"startIndex":0,"endIndex":3,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":40},{"x":550,"y":60},{"x":550,"y":80}],"counts":[1,1,1]},{"startIndex":6,"endIndex":1,"startConnectorIndex":3,"endConnectorIndex":0,"nodes":[{"x":500,"y":380},{"x":480,"y":380},{"x":480,"y":440},{"x":550,"y":440},{"x":550,"y":460},{"x":550,"y":475}],"counts":[1,1,1,1,1,1]}],"x0":-313.5,"y0":147.5}
|
BIN
lab4/lab4-2/diagram.png
Normal file
After Width: | Height: | Size: 73 KiB |
22
lab4/lab4-2/lab4-2.c
Normal file
@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int n;
|
||||
printf("n = ");
|
||||
scanf_s("%d", &n);
|
||||
|
||||
int i = 1;
|
||||
int step = 0;
|
||||
do {
|
||||
printf("2^%d = %d\n", step, i);
|
||||
i = i * 2;
|
||||
step += 1;
|
||||
} while (step <= n);
|
||||
|
||||
return 0;
|
||||
}
|
138
lab4/lab4-2/lab4-2.vcxproj
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{62419a3d-92ea-49c4-ac3c-beec2b81f7ed}</ProjectGuid>
|
||||
<RootNamespace>lab42</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-2.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="diagram.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
27
lab4/lab4-2/lab4-2.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-2.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="diagram.png">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
24
lab4/lab4-3/lab4-3.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <Windows.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
SetConsoleCP(1251);
|
||||
SetConsoleOutputCP(1251);
|
||||
|
||||
int sum, year;
|
||||
float percent;
|
||||
printf("sum = ");
|
||||
scanf_s("%d", &sum);
|
||||
printf("percent = ");
|
||||
scanf_s("%f", &percent);
|
||||
|
||||
year = 0;
|
||||
do {
|
||||
printf("%d RUB in %d year\n", sum, year);
|
||||
sum = (sum * (100 + percent)) / 100;
|
||||
year += 1;
|
||||
} while (year <= 10);
|
||||
|
||||
return 0;
|
||||
}
|
135
lab4/lab4-3/lab4-3.vcxproj
Normal file
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{128509a7-4949-4dfa-990a-9e2d828dd1d1}</ProjectGuid>
|
||||
<RootNamespace>lab43</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-3.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
22
lab4/lab4-3/lab4-3.vcxproj.filters
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-3.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
1
lab4/lab4-6/diagram.json
Normal file
@ -0,0 +1 @@
|
||||
{"blocks":[{"x":550,"y":700,"text":"конец","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":-20,"text":"ввод n","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":-100,"text":"начало","width":100,"height":30,"type":"Начало / конец","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":80,"text":"a = 0.0\nb = 1.0\nn = n - 2","width":100,"height":60,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":170,"text":"n ≤ 0","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":720,"y":170,"text":"вывод\n\"wrong number\"","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":260,"text":"вывод \"0\\n1\\n\"","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":370,"text":"с = a + b\na = b\nb = c","width":100,"height":60,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":460,"text":"вывод c","width":120,"height":40,"type":"Ввод / вывод","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":540,"text":"n = n -1","width":100,"height":40,"type":"Блок","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1},{"x":550,"y":620,"text":"n > 0","width":100,"height":40,"type":"Условие","isMenuBlock":false,"fontSize":14,"textHeight":14,"isBold":false,"isItalic":false,"textAlign":"center","labelsPosition":1}],"arrows":[{"startIndex":2,"endIndex":1,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":-85},{"x":550,"y":-60},{"x":550,"y":-40}],"counts":[1,1,1]},{"startIndex":1,"endIndex":3,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":0},{"x":550,"y":30},{"x":550,"y":50}],"counts":[1,1,1]},{"startIndex":4,"endIndex":5,"startConnectorIndex":1,"endConnectorIndex":3,"nodes":[{"x":600,"y":170},{"x":640,"y":170},{"x":660,"y":170}],"counts":[1,1,1]},{"startIndex":4,"endIndex":6,"startConnectorIndex":3,"endConnectorIndex":0,"nodes":[{"x":500,"y":170},{"x":480,"y":170},{"x":480,"y":220},{"x":550,"y":220},{"x":550,"y":240}],"counts":[1,1,1,1,1]},{"startIndex":6,"endIndex":7,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":280},{"x":550,"y":320},{"x":550,"y":340}],"counts":[1,1,1]},{"startIndex":7,"endIndex":8,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":400},{"x":550,"y":420},{"x":550,"y":440}],"counts":[1,1,1]},{"startIndex":8,"endIndex":9,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":480},{"x":550,"y":500},{"x":550,"y":520}],"counts":[1,1,1]},{"startIndex":9,"endIndex":10,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":560},{"x":550,"y":580},{"x":550,"y":600}],"counts":[1,1,1]},{"startIndex":10,"endIndex":7,"startConnectorIndex":1,"endConnectorIndex":0,"nodes":[{"x":600,"y":620},{"x":670,"y":620},{"x":670,"y":320},{"x":550,"y":320},{"x":550,"y":340}],"counts":[1,1,1,1,1]},{"startIndex":10,"endIndex":0,"startConnectorIndex":3,"endConnectorIndex":0,"nodes":[{"x":500,"y":620},{"x":480,"y":620},{"x":480,"y":660},{"x":550,"y":660},{"x":550,"y":685}],"counts":[1,1,1,1,1]},{"startIndex":5,"endIndex":0,"startConnectorIndex":2,"endConnectorIndex":1,"nodes":[{"x":720,"y":190},{"x":720,"y":700},{"x":620,"y":700},{"x":600,"y":700}],"counts":[1,1,1,1]},{"startIndex":3,"endIndex":4,"startConnectorIndex":2,"endConnectorIndex":0,"nodes":[{"x":550,"y":110},{"x":550,"y":130},{"x":550,"y":150}],"counts":[1,1,1]}],"x0":-388.5,"y0":163}
|
BIN
lab4/lab4-6/diagram.png
Normal file
After Width: | Height: | Size: 135 KiB |
42
lab4/lab4-6/lab4-6.c
Normal file
@ -0,0 +1,42 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
printf("num of fibonacchi numbers = ");
|
||||
scanf_s("%d", &n);
|
||||
|
||||
double a = 0.0;
|
||||
double b = 1.0;
|
||||
double c;
|
||||
n = n - 2;
|
||||
|
||||
if (n <= 0) {
|
||||
puts("wrong number");
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("0\n1\n");
|
||||
|
||||
do {
|
||||
c = a + b;
|
||||
a = b;
|
||||
/*if (b > c) {
|
||||
printf("overflow, remaining n = %d", n);
|
||||
break;
|
||||
}*/
|
||||
b = c;
|
||||
printf("%.0f\n", c);
|
||||
n = n - 1;
|
||||
} while (n > 0);
|
||||
|
||||
/*puts("\n------------");
|
||||
|
||||
if (pow(2, 64) > 12200160415121876738.0) {
|
||||
printf("%f is bigger than %f", pow(2, 64), 12200160415121876738.0);
|
||||
} else {
|
||||
puts("12200160415121876738 is bigger");
|
||||
}*/
|
||||
//printf("%u", sizeof(12200160415121876738));
|
||||
return 0;
|
||||
}
|
138
lab4/lab4-6/lab4-6.vcxproj
Normal file
@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{24b5ae7c-9d69-4852-a0a4-97785eb8e097}</ProjectGuid>
|
||||
<RootNamespace>lab46</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-6.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="diagram.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
27
lab4/lab4-6/lab4-6.vcxproj.filters
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lab4-6.c">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="diagram.png">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
61
lab4/lab4.sln
Normal file
@ -0,0 +1,61 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.11.35222.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab4-1", "lab4-1\lab4-1.vcxproj", "{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab4-2", "lab4-2\lab4-2.vcxproj", "{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab4-3", "lab4-3\lab4-3.vcxproj", "{128509A7-4949-4DFA-990A-9E2D828DD1D1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab4-6", "lab4-6\lab4-6.vcxproj", "{24B5AE7C-9D69-4852-A0A4-97785EB8E097}"
|
||||
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
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Debug|x64.Build.0 = Debug|x64
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Release|x64.ActiveCfg = Release|x64
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Release|x64.Build.0 = Release|x64
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D70249DB-8680-4D0A-83C4-D7FA9AE642D3}.Release|x86.Build.0 = Release|Win32
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Debug|x64.Build.0 = Debug|x64
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Debug|x86.Build.0 = Debug|Win32
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Release|x64.ActiveCfg = Release|x64
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Release|x64.Build.0 = Release|x64
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Release|x86.ActiveCfg = Release|Win32
|
||||
{62419A3D-92EA-49C4-AC3C-BEEC2B81F7ED}.Release|x86.Build.0 = Release|Win32
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Debug|x64.Build.0 = Debug|x64
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Debug|x86.Build.0 = Debug|Win32
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Release|x64.ActiveCfg = Release|x64
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Release|x64.Build.0 = Release|x64
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Release|x86.ActiveCfg = Release|Win32
|
||||
{128509A7-4949-4DFA-990A-9E2D828DD1D1}.Release|x86.Build.0 = Release|Win32
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Debug|x64.Build.0 = Debug|x64
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Debug|x86.Build.0 = Debug|Win32
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Release|x64.ActiveCfg = Release|x64
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Release|x64.Build.0 = Release|x64
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Release|x86.ActiveCfg = Release|Win32
|
||||
{24B5AE7C-9D69-4852-A0A4-97785EB8E097}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {38372524-E44F-4A45-A8AC-2F2CE6B490E5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
BIN
lab5-6-7-8-11/1.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
lab5-6-7-8-11/chevrolet.jpg
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
lab5-6-7-8-11/diagLogo.png
Normal file
After Width: | Height: | Size: 83 KiB |
31
lab5-6-7-8-11/lab5-6-7-8.sln
Normal file
@ -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}") = "lab5-6", "lab5-6\lab5-6.vcxproj", "{338A83EB-228F-46AE-BB48-647AA29D24F9}"
|
||||
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
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Debug|x64.Build.0 = Debug|x64
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Debug|x86.Build.0 = Debug|Win32
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Release|x64.ActiveCfg = Release|x64
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Release|x64.Build.0 = Release|x64
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Release|x86.ActiveCfg = Release|Win32
|
||||
{338A83EB-228F-46AE-BB48-647AA29D24F9}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {880FA844-6AB5-4C5E-9A0F-6D683EECA3EA}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
15
lab5-6-7-8-11/lab5-6/framework.h
Normal file
@ -0,0 +1,15 @@
|
||||
// header.h: включаемый файл для стандартных системных включаемых файлов
|
||||
// или включаемые файлы для конкретного проекта
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#define WIN32_LEAN_AND_MEAN // Исключите редко используемые компоненты из заголовков Windows
|
||||
// Файлы заголовков Windows
|
||||
#include <windows.h>
|
||||
// Файлы заголовков среды выполнения C
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
642
lab5-6-7-8-11/lab5-6/lab5-6-7-8.cpp
Normal file
@ -0,0 +1,642 @@
|
||||
// lab5-6.cpp : Определяет точку входа для приложения.
|
||||
//
|
||||
|
||||
#include "framework.h"
|
||||
#include "lab5-6.h"
|
||||
#include "stdio.h"
|
||||
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
// Глобальные переменные:
|
||||
HINSTANCE hInst; // текущий экземпляр
|
||||
WCHAR szTitle[MAX_LOADSTRING]; // Текст строки заголовка
|
||||
WCHAR szWindowClass[MAX_LOADSTRING]; // имя класса главного окна
|
||||
|
||||
// Отправить объявления функций, включенных в этот модуль кода:
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
_In_opt_ HINSTANCE hPrevInstance,
|
||||
_In_ LPWSTR lpCmdLine,
|
||||
_In_ int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
// TODO: Разместите код здесь.
|
||||
|
||||
// Инициализация глобальных строк
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_LAB56, szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Выполнить инициализацию приложения:
|
||||
if (!InitInstance (hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_LAB56));
|
||||
|
||||
MSG msg;
|
||||
|
||||
// Цикл основного сообщения:
|
||||
while (GetMessage(&msg, nullptr, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: MyRegisterClass()
|
||||
//
|
||||
// ЦЕЛЬ: Регистрирует класс окна.
|
||||
//
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASSEXW wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
|
||||
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wcex.lpfnWndProc = WndProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_LAB56));
|
||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_LAB56);
|
||||
wcex.lpszClassName = szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
|
||||
return RegisterClassExW(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: InitInstance(HINSTANCE, int)
|
||||
//
|
||||
// ЦЕЛЬ: Сохраняет маркер экземпляра и создает главное окно
|
||||
//
|
||||
// КОММЕНТАРИИ:
|
||||
//
|
||||
// В этой функции маркер экземпляра сохраняется в глобальной переменной, а также
|
||||
// создается и выводится главное окно программы.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Сохранить маркер экземпляра в глобальной переменной
|
||||
|
||||
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
|
||||
|
||||
if (!hWnd)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//Рисует квадратную сетку с шагом в 50 пикселей от нуля до указанных координат
|
||||
void drawNet(HDC hdc, int width, int height) {
|
||||
for (int i = 0; i <= width; i = i + 50) {
|
||||
MoveToEx(hdc, i, 0, NULL);
|
||||
LineTo(hdc, i, height);
|
||||
}
|
||||
|
||||
for (int i = 0; i <= height; i = i + 50) {
|
||||
MoveToEx(hdc, 0, i, NULL);
|
||||
LineTo(hdc, width, i);
|
||||
}
|
||||
}
|
||||
|
||||
void drawTractor(HDC hdc, int cx, int cy) {
|
||||
HBRUSH hBrush;
|
||||
HPEN hPen;
|
||||
hBrush = CreateSolidBrush(RGB(0, 0, 150));
|
||||
SelectObject(hdc, hBrush);
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(0, 0, 100));
|
||||
SelectObject(hdc, hPen);
|
||||
Rectangle(hdc, cx-150, cy-50, cx+150, cy+50);
|
||||
MoveToEx(hdc, cx + 150, cy - 50, NULL);
|
||||
LineTo(hdc, cx + 150, cy - 150);
|
||||
LineTo(hdc, cx + 50, cy - 150);
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(153, 217, 234));
|
||||
SelectObject(hdc, hPen);
|
||||
LineTo(hdc, cx, cy - 50);
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(0, 0, 0));
|
||||
SelectObject(hdc, hPen);
|
||||
hBrush = CreateHatchBrush(HS_DIAGCROSS, RGB(20, 20, 20));
|
||||
SelectObject(hdc, hBrush);
|
||||
Ellipse(hdc, cx-175, cy+25, cx-75, cy+125);
|
||||
Ellipse(hdc, cx + 25, cy - 25, cx + 175, cy + 125);
|
||||
DeleteObject(hPen);
|
||||
DeleteObject(hBrush);
|
||||
}
|
||||
|
||||
void drawHouse(HDC hdc){
|
||||
HPEN hPen;
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(255, 0, 0));
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
//крыша и стены
|
||||
MoveToEx(hdc, 150, 250, NULL);
|
||||
LineTo(hdc, 300, 50);
|
||||
LineTo(hdc, 450, 250);
|
||||
LineTo(hdc, 150, 250);
|
||||
LineTo(hdc, 150, 500);
|
||||
LineTo(hdc, 450, 500);
|
||||
LineTo(hdc, 450, 250);
|
||||
//окно
|
||||
MoveToEx(hdc, 200, 300, NULL);
|
||||
LineTo(hdc, 200, 400);
|
||||
LineTo(hdc, 300, 400);
|
||||
LineTo(hdc, 300, 300);
|
||||
LineTo(hdc, 200, 300);
|
||||
MoveToEx(hdc, 250, 300, NULL);
|
||||
LineTo(hdc, 250, 400);
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawSpruce(HDC hdc) {
|
||||
HPEN hPen;
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(30, 200, 80));
|
||||
SelectObject(hdc, hPen);
|
||||
//ёлка
|
||||
MoveToEx(hdc, 0, 600, NULL);
|
||||
LineTo(hdc, 150, 600);
|
||||
LineTo(hdc, 75, 500);
|
||||
LineTo(hdc, 0, 600);
|
||||
MoveToEx(hdc, 25, 500, NULL);
|
||||
LineTo(hdc, 125, 500);
|
||||
LineTo(hdc, 75, 400);
|
||||
LineTo(hdc, 25, 500);
|
||||
MoveToEx(hdc, 50, 400, NULL);
|
||||
LineTo(hdc, 100, 400);
|
||||
LineTo(hdc, 75, 300);
|
||||
LineTo(hdc, 50, 400);
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawCar(HDC hdc) {
|
||||
HPEN hPen;
|
||||
HBRUSH hBrush;
|
||||
//корпус авто
|
||||
hBrush = CreateSolidBrush(RGB(100, 100, 100));
|
||||
SelectObject(hdc, hBrush);
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(50, 50, 50));
|
||||
SelectObject(hdc, hPen);
|
||||
Rectangle(hdc, 550, 350, 850, 450);
|
||||
//крыша авто
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(0, 162, 232));
|
||||
SelectObject(hdc, hPen);
|
||||
MoveToEx(hdc, 550, 350, NULL);
|
||||
LineTo(hdc, 650, 250);
|
||||
LineTo(hdc, 800, 250);
|
||||
LineTo(hdc, 850, 350);
|
||||
//колёса
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(0, 0, 0));
|
||||
SelectObject(hdc, hPen);
|
||||
hBrush = CreateHatchBrush(HS_DIAGCROSS, RGB(20, 20, 20));
|
||||
SelectObject(hdc, hBrush);
|
||||
Ellipse(hdc, 560, 410, 640, 490);
|
||||
Ellipse(hdc, 560 + 200, 410, 640 + 200, 490);
|
||||
DeleteObject(hPen);
|
||||
DeleteObject(hBrush);
|
||||
}
|
||||
|
||||
void drawTree(HDC hdc) {
|
||||
HPEN hPen;
|
||||
HBRUSH hBrush;
|
||||
//ствол дерева
|
||||
hPen = CreatePen(PS_SOLID, 25, RGB(114, 78, 54));
|
||||
SelectObject(hdc, hPen);
|
||||
MoveToEx(hdc, 950, 500, NULL);
|
||||
LineTo(hdc, 950, 200);
|
||||
//листва дерева
|
||||
hPen = CreatePen(PS_SOLID, 5, RGB(30, 150, 80));
|
||||
SelectObject(hdc, hPen);
|
||||
hBrush = CreateHatchBrush(HS_DIAGCROSS, RGB(30, 210, 80));
|
||||
SelectObject(hdc, hBrush);
|
||||
Ellipse(hdc, 850, 50, 1050, 350);
|
||||
DeleteObject(hPen);
|
||||
DeleteObject(hBrush);
|
||||
}
|
||||
|
||||
//Рисует логотип Шевроле
|
||||
void drawLogo(HDC hdc, int cx, int cy) {
|
||||
POINT pt[12];
|
||||
pt[0].x = cx + 50; pt[0].y = cy + 50;
|
||||
pt[1].x = cx - 50; pt[1].y = cy + 50;
|
||||
pt[2].x = cx - 50; pt[2].y = cy + 25;
|
||||
pt[3].x = cx - 150; pt[3].y = cy + 25;
|
||||
pt[4].x = cx - 125; pt[4].y = cy - 25;
|
||||
pt[5].x = cx - 50; pt[5].y = cy - 25;
|
||||
pt[6].x = cx - 50; pt[6].y = cy - 50;
|
||||
pt[7].x = cx + 50; pt[7].y = cy - 50;
|
||||
pt[8].x = cx + 50; pt[8].y = cy - 25;
|
||||
pt[9].x = cx + 150; pt[9].y = cy - 25;
|
||||
pt[10].x = cx + 125; pt[10].y = cy + 25;
|
||||
pt[11].x = cx + 50; pt[11].y = cy + 25;
|
||||
|
||||
HPEN hPen;
|
||||
HBRUSH hBrush;
|
||||
hPen = CreatePen(PS_SOLID, 10, RGB(180, 180, 180));
|
||||
hBrush = CreateHatchBrush(HS_CROSS, RGB(255, 215, 104));
|
||||
SelectObject(hdc, hPen);
|
||||
SelectObject(hdc, hBrush);
|
||||
|
||||
Polygon(hdc, pt, 12);
|
||||
|
||||
DeleteObject(hPen);
|
||||
DeleteObject(hBrush);
|
||||
}
|
||||
|
||||
void lab5(HDC hdc) {
|
||||
drawHouse(hdc);
|
||||
drawSpruce(hdc);
|
||||
drawCar(hdc);
|
||||
drawTree(hdc);
|
||||
drawTractor(hdc, 1200, 450);
|
||||
}
|
||||
|
||||
void lab6(HDC hdc) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 1, RGB(255, 0, 0));
|
||||
SelectObject(hdc, hPen);
|
||||
int x1 = 100;
|
||||
do {
|
||||
MoveToEx(hdc, 400, 300, NULL);
|
||||
LineTo(hdc, x1, 100);
|
||||
x1 += 25;
|
||||
} while (x1 <= 700);
|
||||
|
||||
int x2 = 600, y2 = 400;
|
||||
do {
|
||||
MoveToEx(hdc, 800, 400, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x2 += 10;
|
||||
y2 -= 16;
|
||||
} while (x2 < 800);
|
||||
do {
|
||||
MoveToEx(hdc, 800, 400, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x2 += 10;
|
||||
y2 += 16;
|
||||
} while (x2 <= 1000);
|
||||
|
||||
int x3 = 1100;
|
||||
do {
|
||||
MoveToEx(hdc, x3, 50, NULL);
|
||||
LineTo(hdc, x3, 300);
|
||||
x3 += 5;
|
||||
} while (x3 <= 1400);
|
||||
|
||||
int x4 = 100, y4 = 350;
|
||||
int x5 = 400, y5 = 350;
|
||||
int i = 0;
|
||||
do {
|
||||
MoveToEx(hdc, x4, y4, NULL);
|
||||
LineTo(hdc, x5, y5);
|
||||
y4 += 10;
|
||||
x5 -= 10;
|
||||
i++;
|
||||
} while (i <= 30);
|
||||
|
||||
int x6 = 600, y6 = 600;
|
||||
int dy = 10;
|
||||
i = 0;
|
||||
|
||||
do {
|
||||
MoveToEx(hdc, x6, y6 - dy, NULL);
|
||||
LineTo(hdc, x6, y6 + dy);
|
||||
x6 += 10;
|
||||
dy += 10;
|
||||
i++;
|
||||
} while (i < 15);
|
||||
}
|
||||
|
||||
void lab8(HDC hdc) {
|
||||
/*drawLogo(hdc, 155, 55);
|
||||
drawLogo(hdc, 155+300, 55);
|
||||
drawLogo(hdc, 155, 55+300);
|
||||
drawLogo(hdc, 155+300, 55+300);
|
||||
drawLogo(hdc, 155 + 150, 55 + 150);*/
|
||||
|
||||
int x1 = 0, y1 = 0;
|
||||
int i = 0;
|
||||
do {
|
||||
drawLogo(hdc, 155 + x1, 55 + y1);
|
||||
x1 += 125;
|
||||
y1 += 125;
|
||||
i++;
|
||||
} while (i < 5);
|
||||
}
|
||||
|
||||
int imageNum = 1;
|
||||
bool netToggle = true;
|
||||
|
||||
//Рисует картинки по нажатию цифры на клавиатуре
|
||||
void drawImageSequence1(HDC hdc) {
|
||||
switch (imageNum)
|
||||
{
|
||||
case 0:
|
||||
lab5(hdc);
|
||||
break;
|
||||
case 1:
|
||||
drawSpruce(hdc);
|
||||
break;
|
||||
case 2:
|
||||
drawHouse(hdc);
|
||||
break;
|
||||
case 3:
|
||||
drawLogo(hdc, 500, 300);
|
||||
break;
|
||||
case 4:
|
||||
drawCar(hdc);
|
||||
break;
|
||||
case 5:
|
||||
drawTree(hdc);
|
||||
break;
|
||||
case 6:
|
||||
drawTractor(hdc, 1200, 450);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void draw5logos(HDC hdc, RECT rect) {
|
||||
drawLogo(hdc, rect.right - 200, rect.bottom - 100);
|
||||
drawLogo(hdc, rect.right - 200, rect.top + 100);
|
||||
drawLogo(hdc, rect.left + 200, rect.bottom - 100);
|
||||
drawLogo(hdc, rect.right / 2, rect.bottom / 2);
|
||||
}
|
||||
|
||||
void drawImage1(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 4, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[4] = {
|
||||
cx, cy - 20,
|
||||
cx + 20, cy + 20,
|
||||
cx - 20, cy + 20,
|
||||
cx, cy - 20
|
||||
};
|
||||
Polyline(hdc, p, 4);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawImage2(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 4, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[5] = {
|
||||
cx, cy - 20,
|
||||
cx + 20, cy,
|
||||
cx, cy + 20,
|
||||
cx - 20, cy,
|
||||
cx, cy - 20
|
||||
};
|
||||
Polyline(hdc, p, 5);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawImage3(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 4, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[5] = {
|
||||
cx, cy,
|
||||
cx + 20, cy - 20,
|
||||
cx, cy + 20,
|
||||
cx - 20, cy - 20,
|
||||
cx, cy
|
||||
};
|
||||
Polyline(hdc, p, 5);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawImage4(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 4, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[6] = {
|
||||
cx - 20, cy + 20,
|
||||
cx - 20, cy - 20,
|
||||
cx + 20, cy - 20,
|
||||
cx, cy - 10,
|
||||
cx + 20, cy,
|
||||
cx - 20, cy
|
||||
};
|
||||
Polyline(hdc, p, 6);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawImage5(HDC hdc, int cx, int cy, COLORREF color) {
|
||||
HPEN hPen = CreatePen(PS_SOLID, 4, color);
|
||||
SelectObject(hdc, hPen);
|
||||
|
||||
POINT p[6] = {
|
||||
cx, cy ,
|
||||
cx + 20, cy - 20,
|
||||
cx + 20, cy + 20,
|
||||
cx - 20, cy + 20,
|
||||
cx - 20, cy - 20,
|
||||
cx, cy
|
||||
};
|
||||
Polyline(hdc, p, 6);
|
||||
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
|
||||
void drawImageNet(HDC hdc, int cx, int cy, int width, int height, int step, void (*image)(HDC hdc, int cx, int cy, COLORREF color)) {
|
||||
int r, g, b, fb;
|
||||
r = 255;
|
||||
g = 40;
|
||||
b = 0;
|
||||
int dr, dg, db;
|
||||
dr = r / width;
|
||||
dg = (255 - g) / width;
|
||||
db = (255 - b) / height;
|
||||
for (int i = cx; i <= width * step; i += step) {
|
||||
fb = b;
|
||||
for (int j = cy; j <= height * step; j += step) {
|
||||
image(hdc, i, j, RGB(r, g, fb));
|
||||
fb += db;
|
||||
}
|
||||
//r -= dr;
|
||||
g += dg;
|
||||
}
|
||||
}
|
||||
|
||||
enum Modes {
|
||||
image1,
|
||||
image2,
|
||||
image3,
|
||||
image4,
|
||||
image5
|
||||
} mode;
|
||||
|
||||
void drawImageSequence2(HDC hdc, int cx, int cy, int width, int height, int step) {
|
||||
switch (mode)
|
||||
{
|
||||
case image1:
|
||||
drawImageNet(hdc, cx, cy, width, height, step, drawImage1);
|
||||
break;
|
||||
case image2:
|
||||
drawImageNet(hdc, cx, cy, width, height, step, drawImage2);
|
||||
break;
|
||||
case image3:
|
||||
drawImageNet(hdc, cx, cy, width, height, step, drawImage3);
|
||||
break;
|
||||
case image4:
|
||||
drawImageNet(hdc, cx, cy, width, height, step, drawImage4);
|
||||
break;
|
||||
case image5:
|
||||
drawImageNet(hdc, cx, cy, width, height, step, drawImage5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// ФУНКЦИЯ: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
//
|
||||
// ЦЕЛЬ: Обрабатывает сообщения в главном окне.
|
||||
//
|
||||
// WM_COMMAND - обработать меню приложения
|
||||
// WM_PAINT - Отрисовка главного окна
|
||||
// WM_DESTROY - отправить сообщение о выходе и вернуться
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
{
|
||||
int wmId = LOWORD(wParam);
|
||||
// Разобрать выбор в меню:
|
||||
switch (wmId)
|
||||
{
|
||||
case IDM_ABOUT:
|
||||
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
|
||||
break;
|
||||
case IDM_EXIT:
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hWnd, &ps);
|
||||
// TODO: Добавьте сюда любой код прорисовки, использующий HDC...
|
||||
|
||||
RECT rect;
|
||||
GetClientRect(hWnd, &rect);
|
||||
|
||||
if (netToggle) drawNet(hdc, rect.right, rect.bottom); //drawNet(hdc, 1400, 650);
|
||||
|
||||
//drawImageSequence1(hdc);
|
||||
|
||||
//lab5(hdc);
|
||||
|
||||
//lab6(hdc);
|
||||
|
||||
//lab8(hdc);
|
||||
|
||||
//draw5logos(hdc, rect);
|
||||
|
||||
//drawImageNet(hdc, 50, 50, 8, 8, 100, drawImage4);
|
||||
|
||||
//drawImageSequence2(hdc, 50, 50, 12, 8, 100);
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
break;
|
||||
case WM_KEYDOWN:
|
||||
{
|
||||
switch (wParam)
|
||||
{
|
||||
case VK_SPACE:
|
||||
netToggle = !netToggle;
|
||||
break;
|
||||
case 0x30:
|
||||
imageNum = 0;
|
||||
break;
|
||||
case 0x31:
|
||||
imageNum = 1;
|
||||
mode = image1;
|
||||
break;
|
||||
case 0x32:
|
||||
imageNum = 2;
|
||||
mode = image2;
|
||||
break;
|
||||
case 0x33:
|
||||
imageNum = 3;
|
||||
mode = image3;
|
||||
break;
|
||||
case 0x34:
|
||||
imageNum = 4;
|
||||
mode = image4;
|
||||
break;
|
||||
case 0x35:
|
||||
imageNum = 5;
|
||||
mode = image5;
|
||||
break;
|
||||
case 0x36:
|
||||
imageNum = 6;
|
||||
break;
|
||||
}
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Обработчик сообщений для окна "О программе".
|
||||
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return (INT_PTR)TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
}
|
3
lab5-6-7-8-11/lab5-6/lab5-6.h
Normal file
@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
BIN
lab5-6-7-8-11/lab5-6/lab5-6.ico
Normal file
After Width: | Height: | Size: 45 KiB |