Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int zbir = 0, zbir_na_tipki = 0;
- for(int i = 0; i < n; i++) {
- string s;
- cin >> s;
- // s.size() - vraka dolzinata na brojot
- bool se_sostoi_od_parni_cifri = true;
- for(int j = 0; j < s.size(); j++) {
- // s[j] ni vraka karakter
- // s[j] - '0' vraka int
- int digit = s[j] - '0';
- if(digit % 2 == 1) {
- se_sostoi_od_parni_cifri = false;
- break;
- }
- }
- if(se_sostoi_od_parni_cifri == true) {
- zbir += 1;
- zbir_na_tipki += s.size();
- }
- }
- cout << zbir << endl << zbir_na_tipki << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment