Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul255 authored Nov 21, 2018
1 parent fca10b9 commit 9a40d75
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 116A.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>

using namespace std;

int main()
{
int number;
cin >> number;
int in[number], out[number], i, total=0, minCap=0;

for(i=0; i<number; i++){
cin >> out[i] >> in[i];
}

for(i=0; i<number; i++){
total = total + in[i] - out[i];
if(total > minCap)
minCap = total;
}

cout << minCap;
return 0;
}

0 comments on commit 9a40d75

Please sign in to comment.