Advertisement
Guest User

Стратегия контрольная

a guest
Jan 17th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. //
  2. //  main.cpp
  3. //  STRATEGY
  4. //
  5. //  Created by Андрей Москалёв on 17.01.17.
  6. //  Copyright © 2017 Андрей Москалёв. All rights reserved.
  7. //
  8.  
  9. #include <iostream>
  10. #include <cmath>
  11.  
  12. using namespace std;
  13.  
  14. int main(int argc, const char * argv[]) {
  15.     int a, b, c, ans;
  16.     cin >> a >> b >> c;
  17.     if (a < 0) ++a;
  18.     ans = a - b + c;
  19.     if (ans <= 0) --ans;
  20.     cout << ans;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement