Advertisement
anhkiet2507

Untitled

Oct 8th, 2021
2,215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <string>
  4. #include <vector>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8. int main(){
  9.     int t;
  10.     cin >> t;
  11.     cin.ignore();
  12.     while (t--) {
  13.         string s;
  14.         getline(cin, s);
  15.         int a = (int)(s[0] - 48);
  16.         int b = (int)(s[4] - 48);
  17.         int c = (int)(s[8] - 48);
  18.         if(a+b==c){
  19.             cout << "YES" << endl;
  20.         }else{
  21.             cout << "NO" << endl;
  22.         }
  23.     }
  24.     return 0;
  25. }
  26.  
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement