# include & ltstdio.h & gt
Invalid? Master ()
{
Not signed? Dragon? Num// unsigned long integer to count.
int? onecnt? =? 0; // 1
int? Two CNTs? =? 0; //Number of occurrences of the number 2
int? thrcnt? =? 0; //Number of occurrences of the number 3
Printf ("input? Not signed? Dragon? num:"); //Prompt the user to enter an unsigned long integer.
scanf("%ld ",& ampnum); //Get user input, of course, this can be obtained by inputting parameters.
What time? (0? ! =? Num)// num is divided by 10 in each period of the statistical process, and the remainder of 10 is used to judge whether it is 1, 2, 3.
{
What if? ( 1? ==? No.% 10)
{ onecnt++; }
What if? (2? ==? No.% 10)
{ two cnt++; }
What if? (3? ==? No.% 10)
{ thr cnt++; }
num? =? num/ 10;
}
printf("num? Yes? 1:? %d\nnum? Yes? 2:? %d\nnum? Yes? 3:? %d\n ",onecnt,? Two cents? thr CNT); //Print the number of occurrences of 1, 2, 3.
printf("max? cnt? Yes: %d\n ",(onecnt & gttwocnt)? ((onecnt & gtthrcnt)? one CNT:thr CNT):((two CNT & gt; thrcnt)? two CNT:thr CNT)); //Print the most times. Of course, this can be translated into a return value.
//If the number of occurrences is 4, 5, 6, 7, 8, 9, 0 instead of 1, 2, 3, it will not be counted, but the one with the most occurrences in 1, 2, 3 will still be printed.
}