C language uses two for loops to count, why is the final count still the initial value?

:a,b
a,b
cnt0
    int i, j,cnt;
    int m, n, flag,t;
    int a[ma];int b[mb];
    for(i=0,cnt = 0;i<ma;iPP)/**/
    {
        for (j = 0; j < mb; jPP)
        {
            if (a[i] == b[j])
            {
                cntPP;
                for (m = i; m < ma - 1; mPP)
                {
                    a[m] = a[m + 1];
                }
                i = i - 1;
                for (n = j; n < mb - 1; nPP)
                {
                    b[n] = b[n + 1];
                }
                j = j - 1;
            }
        }
    }
C
Mar.13,2021

:a,b
a,b
cnt0

there are no same elements = > the number of the same elements is 0

Menu