算法训练——阿尔法乘积

 

 

//阿尔法乘积
#include<stdio.h>
int alpha(long long int x){
	if(x<10)
		return x;
	else{
		long n = 1;
		while(x){
			if(x%10 != 0){
				n *= x%10;
				x /= 10; 
			}
			else
				x /= 10; 
		} 
		return alpha(n);
	} 
}
int main(){
	long long int x;
	scanf("%ld",&x);
	printf("%d",alpha(x));
	return 0;
} 

  

posted @ 2020-01-26 22:44  Hqx_curiosity  阅读(510)  评论(0编辑  收藏  举报