Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- char str[99999];
- int i = 0, b = 0;
- short niz[99999];
- fflush(stdin);
- do
- {
- scanf("%c", &str[i]);
- i++;
- }
- while(str[i - 1] != '\n');
- for(int j = 0; j < i; j++)
- {
- for(int c = 7; c >= 0; c--)
- {
- if ((str[j] >> c) & 1)
- niz[b] = 1;
- else
- niz[b] = 0;
- b++;
- }
- }
- printf("\n");
- for(int x = 0; x < b - 8; x++)
- printf("%d", niz[x]);
- // for(int x = 0; x < i-1; x++)
- // printf("%d", str[x]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement