Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- vector<int> v;
- for(int i = 0; i < n; i++) {
- int x;
- cin >> x;
- v.push_back(x);
- }
- int brojac=0;
- int cifri =0;
- for(int i=0;n>i;i++){
- int x=v[i];
- int even =1;
- int golemina=0;
- while(x>0) {
- int cifra=x%10;
- if(cifra %2==1){
- even=0;
- }
- golemina++;
- x/=10;
- }
- if(even==1) {
- brojac++;
- cifri+=golemina;
- }
- }
- cout<<brojac<<endl<<cifri<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement