while ( (c=getchar())&&(c!=\'E\') )
{   
        ++cnt;
        if (c >= \'0\' && c <= \'9\')
        ++digit_cnt;
}
i = -5;
n = 50;
while (i < n)  
{
       ++i;
       total += i;
       printf(\"i = %d and total = %d\\n\", i, total);
}

이러케하면 될거같음 확인은 안해봄