fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. unsigned int input1,input2;
  5. int sum,dif;
  6.  
  7. printf("input1:");
  8. scanf("%x",&input1);
  9. printf("input:");
  10. scanf("%x",&input2);
  11.  
  12. sum = input1+input2;
  13. dif = input1-input2;
  14.  
  15. printf("input1+input2 = %d(0x%x)\n",sum,sum);
  16. printf("input1-input2 = %d(0x%x)\n",dif,dif);
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 2252KB
stdin
0x20
0x01
stdout
input1:input:input1+input2 = 33(0x21)
input1-input2 = 31(0x1f)