Evaluate the array length:
Sizeof (a)/sizeof (A [0])
Determine the number of digits:
Int Cun (int n) {n = ABS (n); // with this sentence added, you can judge that the negative number is if (n <10) return 1; return Cun (N % 10) + 1 ;}
N power of 10:
# Include <math. h> int n = 5; Double X = POW (10.0, N );
Number of each digit of the extracted number: divide by 10 (http://hi.baidu.com/fov42550564/blog/item/f3bbe5335db412fe1b4cffb0.html)
Conversion between strings and numbers:
Sprintf and scanf functions ()
Use C ++'s streanstream: # include <sstream> # include <string> string num2str (double I) {stringstream SS; SS <I; return ss. STR ();} string to numeric: int str2num (string s) {int num; stringstream SS (s); SS >>> num; return num ;}
Http://www.cnblogs.com/xinsheng/archive/2012/02/15/2353252.html
Http://hi.baidu.com/mycral/blog/item/9419f1125db95dc4f6039ecd.html