You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int n=0,ans=0;
|
|
cin >>n;
|
|
int tmp=n;
|
|
while(tmp>=1) {
|
|
if(tmp%10==2) ans++;
|
|
tmp/=10;
|
|
}
|
|
cout<<ans;
|
|
return 0;
|
|
}
|
|
|
|
|