Advertisement
lukasd

zadanie 3 zestaw 15 (do dokończenia)

Dec 29th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. void kolos1()
  2. {
  3.     char a[4];
  4.     scanf("%d, %d, %d, %d",&a[0], &a[1], &a[2], &a[3]);
  5.  
  6.     char maska[4];
  7.     scanf("%d, %d, %d, %d", &maska[0], &maska[1], &maska[2], &maska[3]);
  8.  
  9.     char podsciec[4];
  10.  
  11.     for (int i = 0; i < 4; i++)
  12.     {
  13.         podsciec[i] = a[i] & maska[i];
  14.     }
  15.  
  16.     char hostpierwszy[4];
  17.     for (int i = 0; i < 4; i++)
  18.     {
  19.         hostpierwszy[i] = podsciec[i];
  20.     }
  21.    
  22.     hostpierwszy[3] = hostpierwszy[3] | 0b00000001;
  23.  
  24.    
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement