-
Notifications
You must be signed in to change notification settings - Fork 0
/
amd.c
47 lines (40 loc) · 768 Bytes
/
amd.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Standard library for usage in the process of compilation to x64
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <time.h>
int64_t mayhem(){
static int init = 0;
if (init == 0){
srand(time(NULL));
init = 1;
}
return rand();
}
void printBool(int64_t c){
if (c == 0)
fprintf(stdout, "false");
else
fprintf(stdout, "true");
fflush(stdout);
}
void printInt(long int num){
fprintf(stdout, "%ld", num);
fflush(stdout);
}
void printString(const char * str){
fprintf(stdout, "%s", str);
fflush(stdout);
}
int64_t getBool(){
char c;
scanf("%c", &c);
getchar(); // Consume trailing newline
return c == '0' ? 0 : 1;
}
int64_t getInt(){
char buffer[32];
fgets(buffer, 32, stdin);
long int res = atol(buffer);
return res;
}