Advertisement
Aminpro

[ECP1026]Set example

Dec 12th, 2012
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. typedef unsigned int set;
  5.  
  6. set x = (1<<1)|(1<<2)|(1<<3);
  7. set y = (1<<2)|(1<<4)|(1<<6);
  8. set z1 = x&y;
  9. set z2 = x|y;
  10.  
  11. x = (1<<8 |x;
  12. printf("Is z in X?");
  13.  
  14. if ((1<<2) & x){
  15.     printf("Yes");
  16. else
  17.     printf("No");
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement