取数字的方法

取数字

对于一个数字,要提取其各位数上的数字,用如下方法

		while(a != 0){
			i = 0;
			b[i] = a % 10;
			a /= 10; 
			i++;
		}

以前我只会知道位数的数字提取各位数数字,用这个方法可以解决不知道位数的各位数字。
来自洛谷P1980

猜你喜欢

转载自blog.csdn.net/chengqidexue/article/details/86558695