整数组合.c 266 B

12345678910111213141516
  1. #include <stdio.h>
  2. int main() {
  3. unsigned short x, y, z;
  4. // 从键盘输入x和y的值
  5. scanf("%hu %hu", &x, &y);
  6. // 将x的高8位作为z的高8位,y的高8位作为z的低8位
  7. z = ((x >> 8) << 8) | (y >> 8);
  8. // 输出z的值
  9. printf("%hu\n", z);
  10. return 0;
  11. }