diff --git a/README.md b/README.md index 50b8bb1..cedf7c1 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ 1. Выполнить клонирование репозитария из своего аккаунта к себе на локальную машину. 1. Создать ветку **git** с индивидуальным номером. 1. Сделать ветку активной. -1. Поместить в **include** каталог файл **task1.h**, а в **src** - файлы **task1.cpp**, **task2.cpp**. +1. Поместить в **include** каталог файл **task1.h**, а в **src** - файлы **task1.cpp**, **main1.cpp**. 1. Добавить файлы в хранилище **git add .** 1. Выполнить фиксацию изменений **git commit -m "комментарий"** 1. Отправить содержимое ветки в свой удаленный репозитарий **git push origin имя_ветки** diff --git a/include/task1.h b/include/task1.h new file mode 100644 index 0000000..e257dd9 --- /dev/null +++ b/include/task1.h @@ -0,0 +1 @@ +int ageCheck(int age); diff --git a/main1.cpp b/main1.cpp new file mode 100644 index 0000000..0088d35 --- /dev/null +++ b/main1.cpp @@ -0,0 +1,15 @@ +#include "task1.h" +#include + +int main() +{ + int age=0; + printf("How old are you?\n"); + scanf("%d", &age); + int result=ageCheck(age); + if (result==1) + printf("Access granted!\n"); + else + printf("Access denied!\n"); + return 0; +} diff --git a/src/main1.cpp b/src/main1.cpp new file mode 100644 index 0000000..0088d35 --- /dev/null +++ b/src/main1.cpp @@ -0,0 +1,15 @@ +#include "task1.h" +#include + +int main() +{ + int age=0; + printf("How old are you?\n"); + scanf("%d", &age); + int result=ageCheck(age); + if (result==1) + printf("Access granted!\n"); + else + printf("Access denied!\n"); + return 0; +} diff --git a/src/task1.cpp b/src/task1.cpp new file mode 100644 index 0000000..f506bf4 --- /dev/null +++ b/src/task1.cpp @@ -0,0 +1,9 @@ +#include "task1.h" +int ageCheck(int age) +{ + if (age >= 18) + return 1; + else + return 0; +} + diff --git a/task1.cpp b/task1.cpp new file mode 100644 index 0000000..834f06a --- /dev/null +++ b/task1.cpp @@ -0,0 +1,9 @@ +#include "task1.h" +int ageCheck(int age) +{ + if (age >= 18) + return 1; + else + return 0; +} + diff --git a/task1.h b/task1.h new file mode 100644 index 0000000..e257dd9 --- /dev/null +++ b/task1.h @@ -0,0 +1 @@ +int ageCheck(int age);