commit
7c42396e23
120 changed files with 2486 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,25 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600 |
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;} |
||||
{\colortbl;\red255\green255\blue255;} |
||||
{\*\expandedcolortbl;;} |
||||
\margl1440\margr1440\vieww10800\viewh8400\viewkind0 |
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 |
||||
|
||||
\f0\fs24 \cf0 https://www.youtube.com/playlist?list=PLVQYiy6xNUxxhvwi0PGmXb5isUdVwmsg8\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxxhvwi0PGmXb5isUdVwmsg8\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxzusAgMiybYwkLvuMFbVat9\ |
||||
\pard\pardeftab720\sl380\partightenfactor0 |
||||
\cf0 https://www.youtube.com/playlist?list=PLVQYiy6xNUxwmUOmyYSaI6gD1UyfF9MSj\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxx8sKygTdqtOPytqN7sb0Vz\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxw_vu1L7tOoddOsHnZQwVf7\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxw6n6q_i8wek6U7t7CeAXhU\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxxMI_GiGGb2hxMcd3IwNYRy\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxzNYF00nlmx624twFlamqLt\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxxDlCkkCX262SI90TsllYUW\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxxZbeH9b0VC-nC6QsJRw5Ah\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxzlA5vk2B1xVjjGBJy7R4X4\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxyT9xyetVAA3jPMlIpYpl5S\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxzpalWNSNJc4wEDmfs2Mj5t\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxytsXWxZx6odBJMbRktIHTs\ |
||||
https://www.youtube.com/playlist?list=PLVQYiy6xNUxz5wbzZn4tfUhF4djgzscB-\ |
||||
} |
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_putchar.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/03 09:15:01 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/03 09:15:42 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
@ -0,0 +1,25 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_print_alphabet.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/02 18:31:43 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/03 10:06:48 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_print_alphabet(void) |
||||
{ |
||||
int i; |
||||
|
||||
i = 97; |
||||
while (i <= 122) |
||||
{ |
||||
write(1, &i, 1); |
||||
i++; |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_print_reverse_alphabet.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <masonbee@posteo.net> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/02 18:53:30 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/03 10:28:34 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_print_reverse_alphabet(void) |
||||
{ |
||||
int i; |
||||
|
||||
i = 122; |
||||
while (i >= 97) |
||||
{ |
||||
write(1, &i, 1); |
||||
i--; |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_print_numbers.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/03 10:28:53 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/03 10:40:35 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_print_numbers(void) |
||||
{ |
||||
int i; |
||||
|
||||
i = 48; |
||||
while (i <= 57) |
||||
{ |
||||
write(1, &i, 1); |
||||
i++; |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_is_negative.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/03 10:40:55 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/03 11:19:44 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_is_negative(int n) |
||||
{ |
||||
int o; |
||||
|
||||
o = 78; |
||||
if (n < 0) |
||||
{ |
||||
write(1, &o, 1); |
||||
} |
||||
else |
||||
{ |
||||
o = 80; |
||||
write(1, &o, 1); |
||||
} |
||||
} |
@ -0,0 +1,61 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_print_comb.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/03 11:23:31 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/05 14:08:37 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
||||
|
||||
void print(char i, char b, char c) |
||||
{ |
||||
char m; |
||||
char s; |
||||
|
||||
m = 44; |
||||
s = 32; |
||||
ft_putchar(i); |
||||
ft_putchar(b); |
||||
ft_putchar(c); |
||||
if (!((i == '7') && (b == '8') && (c == '9'))) |
||||
{ |
||||
ft_putchar(m); |
||||
ft_putchar(s); |
||||
} |
||||
} |
||||
|
||||
void ft_print_comb(void) |
||||
{ |
||||
char b; |
||||
char c; |
||||
char i; |
||||
|
||||
i = '0'; |
||||
b = '1'; |
||||
c = '2'; |
||||
while (i <= '7') |
||||
{ |
||||
b = i + 1; |
||||
while (b <= '8') |
||||
{ |
||||
c = b + 1; |
||||
while (c <= '9') |
||||
{ |
||||
print(i, b, c); |
||||
c++; |
||||
} |
||||
b++; |
||||
} |
||||
i++; |
||||
} |
||||
} |
@ -0,0 +1,45 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_print_comb2.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/05 14:20:26 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/05 15:54:19 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
||||
|
||||
void ft_print_comb2(void) |
||||
{ |
||||
int a; |
||||
int b; |
||||
|
||||
a = 0; |
||||
while (a <= 98) |
||||
{ |
||||
b = a + 1; |
||||
while (b <= 99) |
||||
{ |
||||
ft_putchar('0' + (a / 10)); |
||||
ft_putchar('0' + (a % 10)); |
||||
ft_putchar(32); |
||||
ft_putchar('0' + (b / 10)); |
||||
ft_putchar('0' + (b % 10)); |
||||
if (a != 98) |
||||
{ |
||||
ft_putchar(44); |
||||
ft_putchar(32); |
||||
} |
||||
b++; |
||||
} |
||||
a++; |
||||
} |
||||
} |
@ -0,0 +1,55 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_putnbr.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/04 19:16:59 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/05 13:34:20 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
||||
|
||||
void iterate_nbr(char c, long lnb, int e) |
||||
{ |
||||
int i; |
||||
int f; |
||||
|
||||
f = 0; |
||||
i = 9; |
||||
while (i >= 0) |
||||
{ |
||||
c = 48 + lnb / e; |
||||
if (c != 48 || f == 1) |
||||
{ |
||||
ft_putchar(c); |
||||
f = 1; |
||||
} |
||||
lnb = lnb % e; |
||||
e = e / 10; |
||||
i--; |
||||
} |
||||
} |
||||
|
||||
void ft_putnbr(int nb) |
||||
{ |
||||
char c; |
||||
int e; |
||||
long lnb; |
||||
|
||||
lnb = nb; |
||||
e = 1000000000; |
||||
if (lnb < 0) |
||||
{ |
||||
ft_putchar(45); |
||||
lnb = lnb * -1; |
||||
} |
||||
iterate_nbr(c, lnb, e); |
||||
} |
@ -0,0 +1,37 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_print_combn.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/05 16:06:54 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/05 16:25:54 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write( 1, &c, 1); |
||||
} |
||||
|
||||
void ft_print_combo(int n) |
||||
{ |
||||
int i; |
||||
|
||||
i = 1; |
||||
while (i <= n) |
||||
{ |
||||
ft_putchar(i + 48); |
||||
i++; |
||||
} |
||||
ft_putchar(44); |
||||
ft_putchar(32); |
||||
} |
||||
|
||||
int main() |
||||
{ |
||||
ft_print_combo(6); |
||||
} |
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_ft.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/05 16:54:00 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/05 19:24:16 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
void ft_ft(int *nbr) |
||||
{ |
||||
*nbr = 42; |
||||
} |
@ -0,0 +1,16 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_ultimate_ft.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/05 19:23:26 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/05 19:27:45 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
void ft_ultimate_ft(int *********nbr) |
||||
{ |
||||
*********nbr = 42; |
||||
} |
@ -0,0 +1,20 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_swap.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 08:50:59 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/06 09:44:14 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
void ft_swap(int *a, int *b) |
||||
{ |
||||
int s; |
||||
|
||||
s = *a; |
||||
*a = *b; |
||||
*b = s; |
||||
} |
@ -0,0 +1,17 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_div_mod.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 09:46:45 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/06 10:11:47 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
void ft_div_mod(int a, int b, int *div, int *mod) |
||||
{ |
||||
*div = a / b; |
||||
*mod = a % b; |
||||
} |
@ -0,0 +1,20 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_ultimate_div_mod.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 10:15:14 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/06 10:35:17 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
void ft_ultimate_div_mod(int *a, int *b) |
||||
{ |
||||
int temp; |
||||
|
||||
temp = *a / *b; |
||||
*b = *a % *b; |
||||
*a = temp; |
||||
} |
@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_putstr.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 10:37:20 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/06 14:11:07 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_put_char(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
||||
|
||||
void ft_putstr(char *str) |
||||
{ |
||||
while (*str != '\0') |
||||
{ |
||||
ft_put_char(*str); |
||||
str++; |
||||
} |
||||
} |
@ -0,0 +1,24 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strlen.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 14:20:29 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/06 14:34:49 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_strlen(char *str) |
||||
{ |
||||
int len; |
||||
|
||||
len = 0; |
||||
while (*str != '\0') |
||||
{ |
||||
len++; |
||||
str++; |
||||
} |
||||
return (len); |
||||
} |
@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_rev_int_tab.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 14:36:57 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/06 15:57:22 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
void ft_rev_int_tab(int *tab, int size) |
||||
{ |
||||
int t; |
||||
int i; |
||||
int u; |
||||
|
||||
t = 0; |
||||
i = 0; |
||||
u = size - 1; |
||||
while (i < (size / 2)) |
||||
{ |
||||
t = *(tab + i); |
||||
*(tab + i) = *(tab + u); |
||||
*(tab + u) = t; |
||||
i++; |
||||
u--; |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,37 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_sort_int_tab.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 15:59:35 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/06 17:48:20 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
void ft_sort_int_tab(int *tab, int size) |
||||
{ |
||||
int i; |
||||
int j; |
||||
int s; |
||||
|
||||
j = 0; |
||||
i = 0; |
||||
s = 0; |
||||
while (j < (size - 1)) |
||||
{ |
||||
while (i < (size - 1)) |
||||
{ |
||||
if (*(tab + i) > *(tab + i + 1)) |
||||
{ |
||||
s = *(tab + i); |
||||
*(tab + i) = *(tab + i + 1); |
||||
*(tab + i + 1) = s; |
||||
} |
||||
i++; |
||||
} |
||||
i = 0; |
||||
j++; |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,25 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strcpy.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/06 17:56:31 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/07 09:15:41 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
char *ft_strcpy(char *dest, char *src) |
||||
{ |
||||
int i; |
||||
|
||||
i = 0; |
||||
while (src[i] != '\0') |
||||
{ |
||||
dest[i] = src[i]; |
||||
i++; |
||||
} |
||||
dest[i] = '\0'; |
||||
return (dest); |
||||
} |
@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strncpy.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 09:20:02 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/08 19:18:09 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
char *ft_strncpy(char *dest, char *src, unsigned int n) |
||||
{ |
||||
unsigned int i; |
||||
|
||||
i = 0; |
||||
while (src[i] != '\0' && i < n) |
||||
{ |
||||
dest[i] = src[i]; |
||||
i++; |
||||
} |
||||
while (i < n) |
||||
{ |
||||
dest[i] = '\0'; |
||||
i++; |
||||
} |
||||
return (dest); |
||||
} |
@ -0,0 +1,33 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_str_is_alpha.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 10:54:10 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/08 17:09:52 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_str_is_alpha(char *str) |
||||
{ |
||||
int i; |
||||
int r; |
||||
|
||||
i = 0; |
||||
r = 1; |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] <= 64 || str[i] >= 123) |
||||
{ |
||||
r = 0; |
||||
} |
||||
else if (str[i] >= 91 && str[i] <= 96) |
||||
{ |
||||
r = 0; |
||||
} |
||||
i++; |
||||
} |
||||
return (r); |
||||
} |
@ -0,0 +1,33 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_str_is_numeric.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 11:48:32 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/07 12:53:36 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_str_is_numeric(char *str) |
||||
{ |
||||
int i; |
||||
int r; |
||||
|
||||
i = 0; |
||||
r = 1; |
||||
while (str[i] != '\0') |
||||
{ |
||||
if (str[i] < '0' || str[i] > '9') |
||||
{ |
||||
r = 0; |
||||
} |
||||
i++; |
||||
} |
||||
if (i == 0) |
||||
{ |
||||
r = 1; |
||||
} |
||||
return (r); |
||||
} |
@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_str_is_lowercase.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 12:55:26 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/07 13:10:20 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_str_is_lowercase(char *str) |
||||
{ |
||||
int i; |
||||
int r; |
||||
|
||||
i = 0; |
||||
r = 1; |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] < 'a' || str[i] > 'z') |
||||
{ |
||||
r = 0; |
||||
} |
||||
i++; |
||||
} |
||||
return (r); |
||||
} |
@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_str_is_uppercase.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 13:12:22 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/07 13:17:53 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_str_is_uppercase(char *str) |
||||
{ |
||||
int i; |
||||
int r; |
||||
|
||||
i = 0; |
||||
r = 1; |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] < 'A' || str[i] > 'Z') |
||||
{ |
||||
r = 0; |
||||
} |
||||
i++; |
||||
} |
||||
return (r); |
||||
} |
@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_str_is_printable.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 13:22:40 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/08 17:35:12 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_str_is_printable(char *str) |
||||
{ |
||||
int i; |
||||
int r; |
||||
|
||||
i = 0; |
||||
r = 1; |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] < ' ' || str[i] > '~') |
||||
{ |
||||
r = 0; |
||||
} |
||||
i++; |
||||
} |
||||
return (r); |
||||
} |
@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* wft_strupcase.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 13:30:32 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/08 18:14:06 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
char *ft_strupcase(char *str) |
||||
{ |
||||
int i; |
||||
|
||||
i = 0; |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] >= 'a' && str[i] <= 'z') |
||||
{ |
||||
str[i] = str[i] - 32; |
||||
} |
||||
i++; |
||||
} |
||||
return (str); |
||||
} |
@ -0,0 +1,27 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strlowcase.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 14:09:38 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/08 18:26:24 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
char *ft_strlowcase(char *str) |
||||
{ |
||||
int i; |
||||
|
||||
i = 0; |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] >= 'A' && str[i] <= 'Z') |
||||
{ |
||||
str[i] = str[i] + 32; |
||||
} |
||||
i++; |
||||
} |
||||
return (str); |
||||
} |
@ -0,0 +1,55 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strcapitalize.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 14:18:27 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/09 17:05:23 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
char *ft_strlowcase(char *str) |
||||
{ |
||||
int i; |
||||
|
||||
i = 0; |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] >= 'A' && str[i] <= 'Z') |
||||
{ |
||||
str[i] = str[i] + 32; |
||||
} |
||||
i++; |
||||
} |
||||
return (str); |
||||
} |
||||
|
||||
char *ft_strcapitalize(char *str) |
||||
{ |
||||
int i; |
||||
int t; |
||||
int m; |
||||
|
||||
i = 0; |
||||
t = 'a'; |
||||
m = 0; |
||||
ft_strlowcase(str); |
||||
while (str[i]) |
||||
{ |
||||
if (i > 0) |
||||
t = str[i - 1]; |
||||
if ((t >= '1' && t <= '9') || (t >= 'a' && t <= 'z')) |
||||
m++; |
||||
if (t >= 'A' && t <= 'Z') |
||||
m++; |
||||
if (m == 0 && (str[i] >= 'a' && str[i] <= 'z')) |
||||
str[i] = str[i] - 32; |
||||
m = 0; |
||||
i++; |
||||
} |
||||
if (str[0] >= 'a' && str[0] <= 'z') |
||||
str[0] = str[0] - 32; |
||||
return (str); |
||||
} |
@ -0,0 +1,32 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strlcpy.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 16:25:17 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/08 18:48:31 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
unsigned int ft_strlcpy(char *dest, char *src, unsigned int size) |
||||
{ |
||||
unsigned int i; |
||||
unsigned int l; |
||||
|
||||
i = 0; |
||||
l = 0; |
||||
while (src[i] != '\0' && i < size - 1) |
||||
{ |
||||
dest[i] = src[i]; |
||||
i++; |
||||
l++; |
||||
} |
||||
while (i < size) |
||||
{ |
||||
dest[i] = '\0'; |
||||
i++; |
||||
} |
||||
return (l); |
||||
} |
@ -0,0 +1,54 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_putstr_non_printable.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/07 17:07:50 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/08 19:16:27 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
||||
|
||||
void convert_dec_hex(int t) |
||||
{ |
||||
int r; |
||||
char *hex; |
||||
|
||||
hex = "0123456789abcdf"; |
||||
r = 0; |
||||
ft_putchar(92); |
||||
r = t / 16; |
||||
ft_putchar(hex[r]); |
||||
r = t % 16; |
||||
ft_putchar(hex[r]); |
||||
} |
||||
|
||||
void ft_putstr_non_printable(char *str) |
||||
{ |
||||
int i; |
||||
int t; |
||||
|
||||
i = 0; |
||||
t = 0; |
||||
while (str[i] != '\0') |
||||
{ |
||||
if (str[i] < ' ') |
||||
{ |
||||
t = str[i]; |
||||
convert_dec_hex(t); |
||||
} |
||||
else |
||||
{ |
||||
ft_putchar(str[i]); |
||||
} |
||||
i++; |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,21 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strcmp.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/08 10:28:39 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/11 17:26:49 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_strcmp(char *s1, char *s2) |
||||
{ |
||||
int i; |
||||
|
||||
i = 0; |
||||
while ((s1[i] || s2[i]) && s1[i] == s2[i]) |
||||
i++; |
||||
return (s1[i] - s2[i]); |
||||
} |
@ -0,0 +1,23 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strncmp.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/08 11:59:57 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/12 09:12:11 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_strncmp(char *s1, char *s2, unsigned int n) |
||||
{ |
||||
unsigned int i; |
||||
|
||||
i = 0; |
||||
if (n == 0) |
||||
return (0); |
||||
while ((s1[i] || s2[i]) && s1[i] == s2[i] && i < n - 1) |
||||
i++; |
||||
return (s1[i] - s2[i]); |
||||
} |
@ -0,0 +1,32 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strcat.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/08 12:28:43 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/10 15:00:45 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
char *ft_strcat(char *dest, char *src) |
||||
{ |
||||
int i; |
||||
int d; |
||||
|
||||
i = 0; |
||||
d = 0; |
||||
while (dest[d] != '\0') |
||||
{ |
||||
d++; |
||||
} |
||||
while (src[i] != '\0') |
||||
{ |
||||
dest[d] = src[i]; |
||||
i++; |
||||
d++; |
||||
} |
||||
dest[d] = '\0'; |
||||
return (dest); |
||||
} |
@ -0,0 +1,32 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strncat.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/08 14:08:33 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/10 15:08:59 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
char *ft_strncat(char *dest, char *src, unsigned int nb) |
||||
{ |
||||
unsigned int i; |
||||
int d; |
||||
|
||||
i = 0; |
||||
d = 0; |
||||
while (dest[d] != '\0') |
||||
{ |
||||
d++; |
||||
} |
||||
while (src[i] != '\0' && i < nb) |
||||
{ |
||||
dest[d] = src[i]; |
||||
i++; |
||||
d++; |
||||
} |
||||
dest[d] = '\0'; |
||||
return (dest); |
||||
} |
@ -0,0 +1,42 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strstr.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/08 14:31:12 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/09 19:20:31 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <stdio.h> |
||||
|
||||
char *ft_strstr(char *str, char *to_find) |
||||
{ |
||||
int i; |
||||
int t; |
||||
int o; |
||||
|
||||
i = 0; |
||||
t = 0; |
||||
o = 0; |
||||
while (to_find[t]) |
||||
t++; |
||||
if (t == 0) |
||||
return (str); |
||||
while (str[i]) |
||||
{ |
||||
if (str[i] == to_find[0]) |
||||
{ |
||||
while (str[i + o] == to_find[o]) |
||||
{ |
||||
o++; |
||||
if (o == t) |
||||
return (&str[i]); |
||||
} |
||||
} |
||||
i++; |
||||
} |
||||
return (NULL); |
||||
} |
@ -0,0 +1,31 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strlcat.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/10 08:41:17 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/12 09:26:14 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
unsigned int ft_strlcat(char *dest, char *src, unsigned int size) |
||||
{ |
||||
unsigned int i; |
||||
unsigned int d; |
||||
|
||||
i = 0; |
||||
d = 0; |
||||
while (dest[d] != '\0') |
||||
d++; |
||||
while ((src[i] || dest[d]) && i < size - 1) |
||||
{ |
||||
dest[d] = src[i]; |
||||
i++; |
||||
d++; |
||||
} |
||||
if (size >= 0 && d <= size) |
||||
dest[d] = '\0'; |
||||
return (d); |
||||
} |
Binary file not shown.
@ -0,0 +1,21 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_strlen.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/11 09:10:00 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/11 09:22:21 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_strlen(char *str) |
||||
{ |
||||
int i; |
||||
|
||||
i = 0; |
||||
while (str[i] != '\0') |
||||
i++; |
||||
return (i); |
||||
} |
@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_putstr.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/11 09:22:52 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/11 09:29:00 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
||||
|
||||
void ft_putstr(char *str) |
||||
{ |
||||
int i; |
||||
|
||||
i = 0; |
||||
while (str[i] != '\0') |
||||
{ |
||||
ft_putchar(str[i]); |
||||
i++; |
||||
} |
||||
} |
Binary file not shown.
@ -0,0 +1,56 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_putnbr.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/11 09:31:08 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/21 17:30:43 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
#include <unistd.h> |
||||
|
||||
void ft_putchar(char c) |
||||
{ |
||||
write(1, &c, 1); |
||||
} |
||||
|
||||
long ft_check_input(long nbl) |
||||
{ |
||||
if (nbl == 0) |
||||
{ |
||||
ft_putchar('0'); |
||||
} |
||||
else if (nbl < 0) |
||||
{ |
||||
ft_putchar('-'); |
||||
nbl = nbl * -1; |
||||
} |
||||
return (nbl); |
||||
} |
||||
|
||||
void ft_putnbr(int nb) |
||||
{ |
||||
long f; |
||||
long t; |
||||
long nbl; |
||||
|
||||
f = 1; |
||||
nbl = nb; |
||||
nbl = ft_check_input(nbl); |
||||
t = nbl; |
||||
while (t) |
||||
{ |
||||
t = t / 10; |
||||
f = f * 10; |
||||
} |
||||
while (f > 1) |
||||
{ |
||||
f = f / 10; |
||||
t = (nbl / f) + 48; |
||||
ft_putchar(t); |
||||
nbl = nbl % f; |
||||
} |
||||
} |
@ -0,0 +1,37 @@
|
||||
/* ************************************************************************** */ |
||||
/* */ |
||||
/* ::: :::::::: */ |
||||
/* ft_atoi.c :+: :+: :+: */ |
||||
/* +:+ +:+ +:+ */ |
||||
/* By: tharre <marvin@42.fr> +#+ +:+ +#+ */ |
||||
/* +#+#+#+#+#+ +#+ */ |
||||
/* Created: 2020/07/12 11:18:42 by tharre #+# #+# */ |
||||
/* Updated: 2020/07/21 12:28:10 by tharre ### ########.fr */ |
||||
/* */ |
||||
/* ************************************************************************** */ |
||||
|
||||
int ft_atoi(char *str) |
||||
{ |
||||
int i; |
||||
int p; |
||||
long n; |
||||
|
||||
i = 0; |
||||
p = 1; |
||||
n = 0; |
||||
while ((str[i] >= 9 && str[i] <= 13) || str[i] == ' ') |
||||
i++; |
||||
while (str[i] == '-' || str[i] == '+') |
||||
{ |
||||
if (str[i] == '-') |
||||
p *= -1; |
||||
i++; |
||||
} |
||||
while (str[i] >= '0' && str[i] <= '9') |
||||
{ |
||||
|