Home > Back-end >  No class can't write ah where can help me to see if the problem is? Also can give a reference
No class can't write ah where can help me to see if the problem is? Also can give a reference

Time:09-27

CodePudding user response:

Don't use such as what pow, which in turn take the number of each bit Numbers compare good
 int CountDigit (int number, int digit) {
Int n=0;
If (number & lt; 0) number *=1;//if it is negative into positive,
While (number!=0) {
If (number %==10 digit) n++;//each of 10 modulo get finally a number, determine whether the number is equal to the digit
Number/=10;//remove the last digit number
}
Return n.
}

CodePudding user response:

reference 1st floor qybao response: ,
do not use any pow, such as, in turn, take the number of each bit Numbers compare good
 int CountDigit (int number, int digit) {
Int n=0;
If (number & lt; 0) number *=1;//if it is negative into positive,
While (number!=0) {
If (number %==10 digit) n++;//each of 10 modulo get finally a number, determine whether the number is equal to the digit
Number/=10;//remove the last digit number
}
Return n.
}

Why that there is a problem, the main function, please run the result of wrong

CodePudding user response:

refer to the second floor ycm151 response:
that there is a problem, the main function, please not ah why running results

The main function is a problem with the final print printf
Printf (" XXXX ", b, a, n);//don't use the &

CodePudding user response:

reference qybao reply: 3/f
Quote: refer to the second floor ycm151 response:


That there is a problem, the main function, please not ah why running results

The main function is a problem with the final print printf
Printf (" XXXX ", b, a, n);//don't use the &

Thank you thank you thank you very much
  • Related