算法训练——阿尔法乘积
作者:互联网
//阿尔法乘积 #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; }
标签:乘积,int,阿尔法,long,算法,alpha,include 来源: https://www.cnblogs.com/Hqx-curiosity/p/12235001.html