Advertisement
jeff69

Alaa m ali

Feb 25th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.35 KB | None | 0 0
  1.  
  2. #include <iomanip>
  3. #include <iostream>
  4. #include <functional>
  5. #include <algorithm>
  6. #include <math.h>
  7. #include <cmath>
  8. #include <string>
  9.  
  10. using namespace std;
  11.  
  12. int main(){
  13.     int n;
  14.     int s = 0, z, x, v = 1000000;
  15.     cin >> n;
  16.     for (int i = 0; i < n; i++){
  17.         cin >> x >> z;
  18.         s = s + z - x;
  19.         if (s < v){
  20.             v = s;
  21.         }
  22.     }
  23.     cout << v;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement