Untitled
raw download clone
TEXT
views 35
,
size 329 b
#include<iostream>
using namespace std;
int cif(int a , int b)
{
    if(a <= 9)
    {
        if(a == b)
            return 1;
        return 0;
    }
    if(a % 10 == b)
        return 1 + cif(a / 10 , b);
    return cif(a / 10 , b);
}
int main()
{
    int a , b;
    cin >>a >> b;
    cout << cif(a , b);
}
close fullscreen
Login or Register to edit or fork this paste. It's free.