#include
int fun(int n)
{
int k=1;
while(n)
{k*=n%10;n/=10;}
return k;
}
//以上为满足题意的函数fun,以下为主函数main
void main()
{
int n;
scanf("%d",&n);
printf("%d",fun(n));
}
运行示例:
#include
int fun(int n)
{
int k=1;
while(n)
{k*=n%10;n/=10;}
return k;
}
//以上为满足题意的函数fun,以下为主函数main
void main()
{
int n;
scanf("%d",&n);
printf("%d",fun(n));
}
运行示例: