diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2024-09-20 17:56:55 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2024-09-20 17:56:55 +0100 |
commit | b41a06dceaa2b4432900db98c49e55118b77fdef (patch) | |
tree | 7072e4cc62fcc532ae8150aef929d2ebf6ad778f /comp/lucas-standen-NEA/code2/stdlib/zpylib.c | |
parent | e4b5881fa4af7800ba564d6eae255852bf16d24c (diff) |
pushed alot to the stdlib
Diffstat (limited to 'comp/lucas-standen-NEA/code2/stdlib/zpylib.c')
-rw-r--r-- | comp/lucas-standen-NEA/code2/stdlib/zpylib.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code2/stdlib/zpylib.c b/comp/lucas-standen-NEA/code2/stdlib/zpylib.c new file mode 100644 index 0000000..11b6a88 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/stdlib/zpylib.c @@ -0,0 +1,40 @@ +#include <stdlib.h> +#include <time.h> +#include <stdio.h> + +#include "./String/String.h" + +void printchar(char c){ + putchar(c); +} + +void printint(int i){ + printf("%d", i); +} + +void printfloat(double f){ + printf("%f", f); +} + +char readchar(){ + char c; + scanf("%c", &c); + return c; +} + +int readint(){ + int i; + scanf("%d", &i); + return i; +} + +double readfloat(){ + double f; + scanf("%lf", &f); + return f; +} + +int randint(int lower, int upper){ + srand(time(NULL)); + return rand() % (((upper + 1) - lower) + lower); +} |