Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define ll long long
- #define ld long double
- #define pb push_back
- #define x first
- #define y second
- #define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
- #define PI (atan(1)*4)
- #define mp make_pair
- using namespace std;
- int main()
- {
- fastread;
- int n, ans = 0, val;
- string s;
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> s;
- val = 0;
- for (int j = 0; j < s.size(); j++)
- val += s[j] - '0';
- if (val % 3 == 0)
- ans++;
- }
- cout << ans << '\n';
- return 0;
- }
Add Comment
Please, Sign In to add comment