From e3f101dab201b4dd84f157f35bd79578ee24133c Mon Sep 17 00:00:00 2001 From: Anna Chekanova <134311382+AnnaChekanova@users.noreply.github.com> Date: Mon, 22 May 2023 16:40:49 +0000 Subject: [PATCH 1/2] add solution p n10 --- Source/Pointers/10.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Source/Pointers/10.cpp diff --git a/Source/Pointers/10.cpp b/Source/Pointers/10.cpp new file mode 100644 index 0000000..1ee3b05 --- /dev/null +++ b/Source/Pointers/10.cpp @@ -0,0 +1,16 @@ +#include +#include +using namespace std; +void fun(float* A, float* B, float* C, float* Perimeter, float* Square) { + *Perimeter = *A + *B + *C; + float p = (*A + *B + *C) / 2; + *Square = sqrtf(p * (p - *A)* (p - *B)* (p - *C)); +} +int main() { + float A, B, C, Perimeter, Square; + cin >> A >> B >> C; + fun(&A, &B, &C, &Perimeter, &Square); + cout.precision(2); + cout << fixed << Perimeter << " " << Square << " " << endl; + return 0; +} \ No newline at end of file From bc174bad6d274dfbe2b9e6ab119ce638afa20955 Mon Sep 17 00:00:00 2001 From: Anna Chekanova <134311382+AnnaChekanova@users.noreply.github.com> Date: Mon, 22 May 2023 19:43:39 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c3b161..96a22cc 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ https://github.com/DaniilVdovin/Material-Pointer-Cpp/blob/e5cfa15c414922db5fef19 https://github.com/DaniilVdovin/Material-Pointer-Cpp/blob/e5cfa15c414922db5fef19389cffbb7691890eca/Source/Pointers/8.cpp#L1-L16 9. :white_check_mark: Write a function that takes two numbers as arguments and returns a reduced fraction (25 15, 5/3). Write a program to demonstrate how this function works. https://github.com/DaniilVdovin/Material-Pointer-Cpp/blob/e5cfa15c414922db5fef19389cffbb7691890eca/Source/Pointers/9.cpp#L1-L22 -10. ❌ Write a function that takes three sides of a triangle as arguments and returns the perimeter of the triangle and the area calculated using the Heron formula. Write a program to demonstrate how this function works. +10. :white_check_mark: Write a function that takes three sides of a triangle as arguments and returns the perimeter of the triangle and the area calculated using the Heron formula. Write a program to demonstrate how this function works. +https://github.com/AnnaChekanova/Material-Pointer-Cpp/blob/e3f101dab201b4dd84f157f35bd79578ee24133c/Source/Pointers/10.cpp#L1C1-L16 11. ❌ Write a function that takes the value of the acute angle of a right-angled triangle and the length of the hypotenuse as arguments, and returns the length of the legs, the area of the triangle and the radius of the circumscribed circle. Write a program to demonstrate how this function works. 12. ❌ Write a function that takes the base of an isosceles trapezoid as arguments and returns the perimeter, area and height of the trapezoid. Write a program to demonstrate how this function works. 13. ❌ Write a function that takes age (number of years) as an argument and returns the number of months, days, hours and minutes lived.