Advertisement
Guest User

Persian Party

a guest
Mar 4th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.    
  5.     int n;
  6.         cin>> n;
  7.        
  8.     int a[n], d[n], v=0;
  9.    
  10.         for(int i=0; i<n; i++){
  11.             cin>> a[i];
  12.             cin>> d[i];
  13.        
  14.             v+=d[i]-a[i]+1;
  15.         }      
  16.     cout<< v;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement