Advertisement
MohamedAbdel3al

A. Bit++

Sep 28th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std ;
  4. #define sz(s) int(s.size())
  5. #define all(s) s.begin() , s.end()
  6. #define imin INT_MIN
  7. #define imax INT_MAX
  8. #define ll long long
  9. #define ull unsigned long long
  10. #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs" << "\n";
  11. #define cin(v) for (auto& i : v) cin >> i ;
  12. #define pb(x) push_back(x)
  13. #define getline(s) getline(cin >> ws, s)
  14. #define Mod 1'000'000'007
  15. #define INF 2'000'000'000
  16. #define Num_of_Digits(n) ((int)log10(n)+1)
  17.  
  18. void ABDEL3AL () {
  19. ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
  20. #ifndef ONLINE_JUDGE
  21. freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
  22. #endif
  23. Time
  24. }
  25.  
  26.  
  27. int main() {
  28. ABDEL3AL() ;
  29. int t ; cin >> t ;
  30. int n = 0 ;
  31. while (t--) {
  32. string s ; cin >> s ;
  33. if (s.find('++X') != string :: npos || s.find('X++') != string :: npos) n++ ;
  34. if (s.find('--X') != string :: npos || s.find('X--') != string :: npos) n-- ;
  35.  
  36. }
  37. cout << n ;
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement