Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //100/100
- //Memory: 1.54 MB Time: 0.079 s
- #include <stdio.h>
- #define DNA_LENGTH 5
- #define MAGIC_NUMBER 25001
- #define DOT 46
- char buf[MAGIC_NUMBER], result[DNA_LENGTH + 1];
- unsigned short index;
- int main()
- {
- while (1)
- {
- fgets(buf, MAGIC_NUMBER, stdin);
- index = 0;
- while (index < MAGIC_NUMBER)
- {
- if (*(buf + index) == DOT)
- {
- puts(result);
- return 0;
- }
- result[0] ^= *(buf + index++);
- result[1] ^= *(buf + index++);
- result[2] ^= *(buf + index++);
- result[3] ^= *(buf + index++);
- result[4] ^= *(buf + index++);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement