Codeforces-SolutionsA/1676A Lucky/1676A.cpp

33 lines
518 B
C++
Raw Normal View History

2023-07-28 03:19:08 +08:00
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
string s;
cin>>s;
int first_sum=0, last_sum=0;
for(int i=0; i<s.size(); ++i)
{
if(i<3)
first_sum+=s[i];
else
last_sum+=s[i];
}
if(first_sum==last_sum)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
cin >> TC;
cin.ignore();
while (TC--) solve();
}