S

@sipark

ft_printf

C
1 year ago
#include <unistd.h> #include <stdarg.h> //for test, i include stdio #include <stdio.h> void ft_putchar_fd(char c, int fd) { //write함수는 return값이 길이임 write(fd, &c, 1);

n_queen

C++
1 year ago
#include <stdlib.h> #include <stdio.h> #include <unistd.h> int N; // 체스판 크기 int col[100]; // 각 퀸의 위치를 저장할 배열 int result = 0; // 가능한 해의 개수 // 퀸이 배치 가능한지 여부를 확인하는 함수

tenqueen_incomplete

C
1 year ago
#include <stdio.h> #include <unistd.h> #include <stdlib.h> int abs(int i) { if(i < 0) return -i; return i; }

ten queens - imcomplete

C
1 year ago
#include <stdio.h> int ft_ten_queens_puzzle(void) { } int main()

strjoin

C
1 year ago
#include <stdio.h> #include <stdlib.h> int ft_strlen(char *str) { int i = 0; while(str[i]) i++; return i;

ult_range

C
1 year ago
#include <stdio.h> #include <stdlib.h> //range함수, int *ft_range(int min, int max) { int i; int *range; if (min >= max)

ft_range

C
1 year ago
#include <stdlib.h> int *ft_range(int min, int max) { int i; int *range; if(min >= max) return NULL;

strstr

C
1 year ago
#include <stdio.h> #include <string.h> int ft_strlen(char *str) { int i; i = 0; while (str[i]) i++;

strlcpy

C
1 year ago
#include <unistd.h> #include <stdio.h> unsigned int ft_strlcpy(char *dest, char *src, unsigned int size) { unsigned int i = 0; unsigned src_len = 0; while(src[src_len] != '\0') src_len++;

strdup

C
1 year ago
#include <unistd.h> #include <stdlib.h> #include <stdio.h> char *ft_strdup(char *src) { int i = 0; char *dup; while(src[i] != '\0')

bubble_sort

C
1 year ago
#include <stdio.h> int main() { int arr[5]={10, 3, 15, 12, 1}; int temp; //swap을 위해 선언 for(int i=0;i<5;i++){ for(int j=0;j<4-i;j++){

argc, argv >in main

C
1 year ago
#include <unistd.h> int main(int argc, char *argv[]) { int i = 0; while (argv[0][i] != '\0'){ write(1, &argv[0][i], 1); i++; }

find next prime Number

C
1 year ago
#include <stdio.h> int ft_sqrt(int nb) { int x; int y; if (nb < 0) return (0); x = nb;

primeNumber

C
1 year ago
#include <stdio.h> int ft_sqrt(int nb) { int x; int y; if (nb < 0) return (0); x = nb;

sqrt(Newton)

C
1 year ago
#include <stdio.h> float ft_sqrt(int nb){ float x = nb; float y = (x+1) / 2; printf("y = %f\n", y); while(y < x){ x = y; printf("fx.x = %f\n", x);

fibonacciRecursive

C
1 year ago
#include <stdio.h> int ft_fibonacci(int index) { if(index == 0) return 0; if(index == 1) return 1; if(index < 0) return -1;

power_recursive

C
1 year ago
#include <stdio.h> int ft_recursive_power(int nb, int power){ if(nb == 1 || power == 0) return 1; if(power < 0) return 0; return nb * ft_recursive_power(nb, power-1);

power_while

C
1 year ago
#include <stdio.h> int ft_iterative_power(int nb, int power) { int i = 0; int result = 1; if(nb == 0 || power == 0) return 1; if(power < 0)

str

C
1 year ago
#include <unistd.h> #include <stdio.h> char *ft_strncpy(char *dest, const char *src, unsigned int n) { unsigned int i; i = 0; while (i < n && src[i] != '\0') {

factorial_while

C
1 year ago
#include <stdio.h> int ft_iterative_factorial(int nb){ int i = 1; int result = 1; if(nb < 0) return 0; else if(nb == 1 || nb == 0)