解题思路:
注意事项:
参考代码:
#include<iostream>
#include<iterator>
#include<stdio.h>
#include<iomanip>
#include<string>
#include<cstring>
#include<string.h>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<math.h>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<sstream>
using namespace std;
int main()
{
string s;
cin >> s;
while (1)
{
if (s.length() == 1)
break;
int sum = 1;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == '0')
continue;
else {
sum *= (int)(s[i] - '0');
}
}
stringstream ss;//将int转化为string
ss << sum;
ss >> s;
}
cout << s;
return 0;
}
0.0分
7 人评分