csansoon

P2.17 X32391 Allowance (2)

Sep 26th, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int d,n,t,a,w;
  6.     w=0;
  7.     cin >> d >> n >> t;
  8.     while (cin >> a){
  9.         n-=d;
  10.         n+=a;
  11.         if (n>0) w++;
  12.     }
  13.     cout << w << endl;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment