#include <iostream> #include <cstdlib> #include <string> #include <cmath> #include <algorithm> #include <iterator> #include <numeric> #include <vector> #include <sstream> #include <deque> using namespace std; int f(int n) { int sum=1; while(n!=0) { if(n%10!=0) { sum*=n%10; } n/=10; } return sum; } int main(void){ int n; cin>>n; while(n>9) { n=f(n); } cout<<n<<endl; return 0; }
解题思路:
注意事项:
参考代码:
0.0分
0 人评分
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:765 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:547 |
2005年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:649 |
【计算球体积】 (C语言代码)浏览:1012 |
母牛的故事 (C语言代码)浏览:762 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:676 |
永远的丰碑 (C语言代码)浏览:662 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:693 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:613 |
不会做的浏览:919 |