fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a, b, c, d;
  5. int dx, dy;
  6. scanf("%d%d%d%d",&a, &b, &c, &d);
  7. dx = a-c;
  8. dy = b-d;
  9. if ((dx*dy)<0)
  10. {
  11. printf("%d", -(dx*dy));
  12. }
  13. else if ((dx*dy)>0)
  14. {
  15. printf("%d", dx*dy);
  16. }
  17.  
  18. if (dx == 0 || dy == 0){
  19. printf("%d", 0);
  20. }
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 4464KB
stdin
6
5
6
-3
stdout
Standard output is empty