Advertisement
printesoi

Untitled

May 17th, 2011
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main()
  6. {
  7.     char msg[1000];
  8.     unsigned int *v,l,i,n;
  9.     scanf("%1000s",msg);
  10.     l=strlen(msg);
  11.     l%4?n=l/4+1:n=l/4;
  12.     v=(unsigned int*)calloc(n,sizeof(unsigned int));
  13.    
  14.     for (i=0;i<l;++i) {
  15.         v[i/4] = v[i/4] | msg[i]<<(3-i%4)*8;
  16.     }
  17.     free(v);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement