1 solutions

  • 0
    @ 2023-1-16 10:09:20
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int x;
    	cin >> x;
    	//当这个数各个位的成绩不是一位数数时,对它的乘积继续求解
    	while(x >= 10){
    		int t = 1;
    		//计算整数非0位的乘积
    		while(x != 0){
    			//判断尾数不等于0就累乘
    			if(x%10 != 0){
    				t = t*(x%10);
    			} 
    			//去掉尾数
    			x = x/10; 
    		} 
    		x = t;
    	} 
    	cout << x << endl;
    	return 0;
    }
    
    
    
    • 1

    Information

    ID
    1182
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    10
    Tags
    # Submissions
    3
    Accepted
    3
    Uploaded By