fork(1) download
  1. #include <cstdlib>
  2. #include <iostream>
  3. using namespace std;
  4. int main() {
  5. int x1, y1, x2, y2;
  6. cin >> x1 >> y1 >> x2 >> y2;
  7. int dx = abs(x1 - x2);
  8. int dy = abs(y1 - y2);
  9. cout << dx + dy << endl;
  10. }
  11.  
Success #stdin #stdout 0.01s 5320KB
stdin
1 1 11 21
stdout
30