c盤清理的步驟是什么(如何清理C盤空間)
如何清理C盤空間怎么清理C盤的垃圾文件?每天上網會給電腦帶來很多臨時文件,這些垃圾文件不清理掉時間久了就會影響到電腦的運行速度。那怎
2022/12/08
(相關資料圖)
1.簡述:
輸入一個正整數n,求n!(即階乘)末尾有多少個0? 比如: n = 10; n! = 3628800,所以答案為2
輸入為一行,n(1 ≤ n ≤ 1000)
輸出一個整數,即題目所求
輸入:
10
輸出:
2
2.代碼實現:
public class Main{ public static int test(int n){ if(n < 0){ return 0; } int res = 0; while (n !=0){ res += n /5; n = n/5; } return res; } public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNextInt()) { System.out.println( test(in.nextInt())); } }}
標簽: