int n;
scanf("%d", &n);int fact = 1;int i = 1;while ( i <= n ) { fact *=i; i++;}上述可用 for 循环代替 for (int i = 1; i<= n; i++) { fact *= i;}
posted on 2019-04-30 09:40 阅读( ...) 评论( ...)
本文共 250 字,大约阅读时间需要 1 分钟。
int n;
scanf("%d", &n);int fact = 1;int i = 1;while ( i <= n ) { fact *=i; i++;}上述可用 for 循环代替 for (int i = 1; i<= n; i++) { fact *= i;}
转载于:https://www.cnblogs.com/DemonMaster/p/10794210.html