-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmap.c
29 lines (26 loc) · 1.11 KB
/
map.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* map.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lde-ross < [email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/27 13:50:50 by lde-ross #+# #+# */
/* Updated: 2023/01/27 13:51:06 by lde-ross ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
int map_number(int length, char *argv[], int i)
{
int smaller;
int j;
j = 1;
smaller = 0;
while (j <= length)
{
if (ft_atoi(argv[i]) < ft_atoi(argv[j]))
smaller++;
j++;
}
return (length - smaller);
}