锦(李晨瑞) • 10小时前
using namespace std;
int main() {
int n;
int num = 1;
bool single = false;
cin >> n;
if (n == 0) {
cout << n;
goto end;
} else if (n < 0) {
single = true;
n = abs(n);
}
while (n) {
num *= n % 10;
n /= 10;
}
if (single) {
cout << -num << endl;
} else {
cout << num << endl;
}
end:
return 0;
}
评论:
请先登录,才能进行评论