sync
This commit is contained in:
30
Rush_02/rush-02/ex00/compute/compute.c
Normal file
30
Rush_02/rush-02/ex00/compute/compute.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* compute.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/21 18:36:54 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/21 18:58:39 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include "../ft/ft.h"
|
||||
|
||||
// cc -Wall -Wextra -Werror -o a.out -L../ft -lft compute.c && ./a.out && rm a.out
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *str;
|
||||
|
||||
if (argc < 2)
|
||||
return (1);
|
||||
|
||||
str = argv[1];
|
||||
ft_putstr(str);
|
||||
ft_putstr("\n");
|
||||
return (0);
|
||||
}
|
||||
9
Rush_02/rush-02/ex00/compute/compute.sh
Executable file
9
Rush_02/rush-02/ex00/compute/compute.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
txt=$(basename $0 .sh)".txt"
|
||||
set -e
|
||||
rm -f a.out
|
||||
cc -Wall -Wextra -Werror -o a.out -L../ft -lft *.c
|
||||
cat ${txt} | while read nbr; do
|
||||
./a.out "${nbr}"
|
||||
done
|
||||
rm -f a.out
|
||||
65
Rush_02/rush-02/ex00/compute/compute.txt
Normal file
65
Rush_02/rush-02/ex00/compute/compute.txt
Normal file
@@ -0,0 +1,65 @@
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
30
|
||||
32
|
||||
40
|
||||
43
|
||||
50
|
||||
54
|
||||
60
|
||||
65
|
||||
70
|
||||
76
|
||||
80
|
||||
87
|
||||
90
|
||||
98
|
||||
100
|
||||
123
|
||||
1000
|
||||
1234
|
||||
12345
|
||||
123456
|
||||
1000000
|
||||
1234567
|
||||
1000000000
|
||||
1234567890
|
||||
1000000000000
|
||||
1234567890123
|
||||
1000000000000000
|
||||
1123456789012345
|
||||
1000000000000000000
|
||||
1234567890123456789
|
||||
1000000000000000000000
|
||||
1123456789012345678901
|
||||
1000000000000000000000000
|
||||
1234567890123456789012345
|
||||
1000000000000000000000000000
|
||||
1234567890123456789012345678
|
||||
1000000000000000000000000000000
|
||||
1234567890123456789012345678901
|
||||
1000000000000000000000000000000000
|
||||
1234567890123456789012345678901234
|
||||
1000000000000000000000000000000000000
|
||||
1234567890123456789012345678901234567
|
||||
deadbeef
|
||||
Reference in New Issue
Block a user