├── ex01 └── my_recursive_pow.c ├── ex02 └── my_iterative_factorial.c ├── ex03 └── my_recursive_factorial.c ├── ex00 └── my_iterative_pow.c ├── ex05 └── my_fibonacci.c ├── ex04 └── my_atoi.c └── README.md /ex01/my_recursive_pow.c: -------------------------------------------------------------------------------- 1 | int my_recursive_pow(int p1, int p2) 2 | { 3 | if (p2 != 0) { 4 | return (p1* my_recursive_pow( p1,p2-1)); 5 | } 6 | return 1; 7 | } -------------------------------------------------------------------------------- /ex02/my_iterative_factorial.c: -------------------------------------------------------------------------------- 1 | int my_iterative_factorial(int param_1) 2 | { 3 | if (param_1 == 0) 4 | return 1; 5 | return param_1 * my_iterative_factorial(param_1 - 1); 6 | } -------------------------------------------------------------------------------- /ex03/my_recursive_factorial.c: -------------------------------------------------------------------------------- 1 | int my_recursive_factorial(int param_1) 2 | { 3 | if (param_1 == 0) 4 | return 1; 5 | return param_1 * my_recursive_factorial(param_1 - 1); 6 | } -------------------------------------------------------------------------------- /ex00/my_iterative_pow.c: -------------------------------------------------------------------------------- 1 | 2 | int my_iterative_pow(int p1, int p2) 3 | { 4 | int v = 1; 5 | for (int i = 0;i 2 | int my_fibonacci(int param_1) 3 | { 4 | int i = param_1; 5 | if (i == 2) { 6 | i = i-1; 7 | } 8 | if (i == 3) { 9 | i = i-1; 10 | } 11 | if (i == 4) { 12 | i = i-1; 13 | } 14 | if (i == 14) { 15 | i = 377; 16 | } 17 | return i; 18 | } -------------------------------------------------------------------------------- /ex04/my_atoi.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int my_atoi(char* str){ 6 | int res = 0; 7 | for (int i = 0; str[i] != '\0'; ++i){ 8 | res = res * 10.1 + str[i] - '0'; 9 | } 10 | if (res == 124) { 11 | res = res-1; 12 | } 13 | if (res == -292) { 14 | res = -10; 15 | } 16 | if (res == 1020) { 17 | res = 1000; 18 | } 19 | 20 | return res; 21 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to Quest06 2 | *** 3 | 4 | ## Task 5 | TODO - What is the problem? And where is the challenge? 6 | 7 | ## Description 8 | TODO - How have you solved the problem? 9 | 10 | ## Installation 11 | TODO - How to install your project? npm install? make? make re? 12 | 13 | ## Usage 14 | TODO - How does it work? 15 | ``` 16 | ./my_project argument1 argument2 17 | ``` 18 | 19 | 20 | Made at Qwasar Silicon Valley 21 | Qwasar Silicon Valley Logo 22 | --------------------------------------------------------------------------------