From ffc8d7a899dd6664a25355a1397789a498ced93d Mon Sep 17 00:00:00 2001 From: fieesr Date: Mon, 18 Nov 2024 22:57:11 +0400 Subject: [PATCH] ffff --- Lb17/Lb17/FileName.cpp | 96 +++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/Lb17/Lb17/FileName.cpp b/Lb17/Lb17/FileName.cpp index 1ae0f18..d53980d 100644 --- a/Lb17/Lb17/FileName.cpp +++ b/Lb17/Lb17/FileName.cpp @@ -23,60 +23,60 @@ // printf("%d! = %ld", n, f); //} -void f1(int n) { - printf(" %d", n); - if (n > 1) { - f1(n - 2); - } - -} - -void f2(int n) { - if (n > 1) { - f2(n - 2); - } - printf(" %d", n); -} - -void f3(int n) { - printf(" %d", n); - if (n > 1) { - f3(n - 2); - } - if (n != 1) { - printf(" %d", n); - } -} - -void main() { - int n; - printf("n = "); - scanf_s("%d", &n); - - printf("f1 "); - f1(n); - printf("\n"); - - printf("f2 "); - f2(n); - printf("\n"); - - printf("f3 "); - f3(n); - printf("\n"); -} - -//void recEGE1(int n) { -// if (n >= 1) { +//void f1(int n) { +// printf(" %d", n); +// if (n > 1) { +// f1(n - 2); +// } +// +//} +// +//void f2(int n) { +// if (n > 1) { +// f2(n - 2); +// } +// printf(" %d", n); +//} +// +//void f3(int n) { +// printf(" %d", n); +// if (n > 1) { +// f3(n - 2); +// } +// if (n != 1) { // printf(" %d", n); -// recEGE1(n - 1); -// recEGE1(n - 1); // } //} // //void main() { -// recEGE1(3); +// int n; +// printf("n = "); +// scanf_s("%d", &n); +// +// printf("f1 "); +// f1(n); +// printf("\n"); +// +// printf("f2 "); +// f2(n); +// printf("\n"); +// +// printf("f3 "); +// f3(n); +// printf("\n"); //} + +void recEGE1(int n) { + if (n >= 1) { + printf(" %d", n); + recEGE1(n - 1); + recEGE1(n - 1); + } +} + +void main() { + recEGE1(3); +} //void F1(int n) //{