fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. unsigned char r = 0x80, g = 0x40, b = 0x40, x;
  5.  
  6. x = (r + g + b) / 3;
  7. printf("0x%02X\n", x);
  8. x = r / 3 + g / 3 + b / 3;
  9. printf("0x%02X\n", x);
  10.  
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
0x55
0x54