-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchall.c
More file actions
31 lines (30 loc) · 830 Bytes
/
chall.c
File metadata and controls
31 lines (30 loc) · 830 Bytes
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
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
int c[] = {119, 74, 101, 91, 107, 81, 116, 44, 16, 99, 20, 107, 76, 41, 127, 122, 20, 118, 71, 71, 80, 125, 82, 117, 17, 118, 84, 44, 20, 118, 127, 44, 84, 44, 83, 44, 78, 71, 78, 43, 87, 122, 73, 43, 127, 126, 82, 113, 69, 118, 68, 116, 89, 101};
char inp[100];
printf("apa flagnya\n");
scanf("%s", &inp);
int len = strlen(inp);
if (len != 54)
{
printf("bukan");
return 0;
}
for (int i = 0; i < len; i++)
{
if (i % 2 == 1 && inp[i] != (c[i] ^ 24))
{
printf("bukan");
return 0;
}
else if (i % 2 == 0 && inp[i] != (c[i] ^ 32))
{
printf("bukan");
return 0;
}
}
printf("mantap!!\n");
return 0;
}