标签:space log weight orm 正整数 idt mic 例子 letter
输入为一行,n(1 ≤ n ≤ 1000)
输出一个整数,即题目所求
10
2
方法:Z = N/5 + N /(5*5) + N/(5*5*5).....知道N/(5的K次方)
1 import java.util.Scanner; 2 3 public class Test60 { 4 5 public static void main(String[] args) { 6 7 Scanner in = new Scanner(System.in); 8 int n = in.nextInt(); 9 int count = 0; 10 while(n>0){ 11 count += n/5; 12 n = n/5; 13 } 14 System.out.println(count); 15 in.close(); 16 } 17 18 }
标签:space log weight orm 正整数 idt mic 例子 letter
原文地址:http://www.cnblogs.com/chongerlishan/p/6251763.html