C. Enter a number to remove the number containing 7 and the number divisible by 7.
C. Enter a string of numbers to remove the number containing 7 and the number divisible by 7. Each number is less than 10000, and the number is less than 100.
Input example :,
Output: 1, 2, 45
Note: The number of inputs is uncertain, so it cannot be processed using an integer array. It cannot end with an integer array element equal to \ n, because the array is an integer and \ n is a random type, it cannot be entered.
So we need to use strings for processing. We first take out all integers separated by commas, and then judge and output these numbers.
# Include
# Include
Void main ()
{
Char a [1000000];
Int B [100], c [100];
Int I, j, k, len, t, flag = 0, len1 = 0;
K = 0; len = 0; t = 0;
Gets ();
Len1 = strlen ();
For (I = 0, j = 0; I <=Len1; I ++)
If (a [I]> = '0' & a [I] <= '9 ')
{
T = 10 * t + a [I]-'0 ';
Flag = 1;
}
Else if (flag = 0)
Continue;
Else
{
B [j] = t;
J ++;
Len ++;
T = 0;
Flag = 0;
}
For (j = 0, I = 0; I If (B [I] % 7 = 0) continue;
Else if (B [I] % 10 = 7) continue;
Else if (B [I]/10) % 10 = 7) continue;
Else if (B [I]/100) % 10 = 7) continue;
Else if (B [I]/1000) % 10 = 7) continue;
Else
{
C [j] = B [I];
J ++;
}
For (I = 0; I Printf ("% d,", c [I]);
Printf ("% d \ n", c [J-1]);
}