sync
This commit is contained in:
31
Rush_02/rush-02/ex00/dictionnaries/dictionnaries.c
Normal file
31
Rush_02/rush-02/ex00/dictionnaries/dictionnaries.c
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include "../ft/ft.h"
|
||||
|
||||
#define BUF_SIZE 4096
|
||||
|
||||
// cc -Wall -Wextra -Werror -o a.out -L../ft -lft dictionnaries.c && ./a.out && rm a.out
|
||||
|
||||
int main()
|
||||
{
|
||||
int fd;
|
||||
int ret;
|
||||
char buf[BUF_SIZE + 1];
|
||||
fd = open ("numbers.dict", O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
ft_putstr("open () error");
|
||||
return (1);
|
||||
}
|
||||
ret = read(fd, buf, BUF_SIZE);
|
||||
buf[ret] = '\0';
|
||||
ft_putnbr(ret);
|
||||
ft_putstr(buf);
|
||||
if (close(fd) == -1)
|
||||
{
|
||||
ft_putstr("Close() error");
|
||||
return(1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
41
Rush_02/rush-02/ex00/dictionnaries/numbers.dict
Normal file
41
Rush_02/rush-02/ex00/dictionnaries/numbers.dict
Normal file
@@ -0,0 +1,41 @@
|
||||
0: zero
|
||||
1: one
|
||||
2: two
|
||||
3: three
|
||||
4: four
|
||||
5: five
|
||||
6: six
|
||||
7: seven
|
||||
8: eight
|
||||
9: nine
|
||||
10: ten
|
||||
11: eleven
|
||||
12: twelve
|
||||
13: thirteen
|
||||
14: fourteen
|
||||
15: fifteen
|
||||
16: sixteen
|
||||
17: seventeen
|
||||
18: eighteen
|
||||
19: nineteen
|
||||
20: twenty
|
||||
30: thirty
|
||||
40: forty
|
||||
50: fifty
|
||||
60: sixty
|
||||
70: seventy
|
||||
80: eighty
|
||||
90: ninety
|
||||
100: hundred
|
||||
1000: thousand
|
||||
1000000: million
|
||||
1000000000: billion
|
||||
1000000000000: trillion
|
||||
1000000000000000: quadrillion
|
||||
1000000000000000000: quintillion
|
||||
1000000000000000000000: sextillion
|
||||
1000000000000000000000000: septillion
|
||||
1000000000000000000000000000: octillion
|
||||
1000000000000000000000000000000: nonillion
|
||||
1000000000000000000000000000000000: decillion
|
||||
1000000000000000000000000000000000000: undecillion
|
||||
Reference in New Issue
Block a user