Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int Mean(const string s)
- {
- int sum = 0;
- for (int i = 0; i < s.length();++i)
- sum += int(s[i]);
- return sum / s.length();
- /* у символа "a код равен 97, тогда строка abc -> (97 + 98 + 99) / 3 = 98;*/
- }
- int main()
- {
- int n; cin >> n;//количество строк в наборе
- for (int i = 0; i < n; ++i)
- {
- string cur;//cама строка
- cin >> cur;
- if (Mean(cur) > 70)
- cout << cur << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement