Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
yashinomi committed Oct 16, 2020
0 parents commit 954447d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions debug_test_codes/add.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
int main(void)
{
int a = 3;
int b, c = 2;
b = a + c;
return 0;
}
10 changes: 10 additions & 0 deletions debug_test_codes/add_print.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <stdio.h>

int main(void)
{
int a = 3;
int b, c = 2;
b = a + c;
printf("%d\n", b);
return 0;
}
14 changes: 14 additions & 0 deletions debug_test_codes/collatz.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdlib.h>
#include <stdio.h>

int collatz(int n) {
if (n == 1) return 1;
if (n % 2) return collatz(3 * n + 1);
else return collatz(n / 2);
}


int main(int argc, char const *argv[]){
printf("%d\n", collatz(atoi(argv[1])));
return 0;
}

0 comments on commit 954447d

Please sign in to comment.