《深入理解计算机系统》(第二版)第二章练习题4

来源:互联网 发布:大数据顶尖企业 编辑:程序博客网 时间:2024/05/29 21:28

 #include <stdio.h>                                      #include <stdlib.h>
#include <malloc.h>
#include <math.h>
#include <string.h>
int bytes_equal(int x,int y){
     int w;
    w=x ^ y;
    if(w==0){
         return 1;
    }
    else{
          return 0;
    }
}
void main()
{  
      int a,b;
     scanf("%d %d",&a,&b);
     if(bytes_equal(a,b)==1)
          printf("OK!");
    else
          printf("NO!");
    printf("\n");

}