#include<stdio.h>
int main()
{ long int n;
int a=0;
while(scanf("%d",&n)!=EOF){
while(n>4){
n-=n%5;
a+=n/5;
n/=5;
}
printf("%d\n",a);
a=0;
}
}
#include
int main()
{ long int n;
int a=0;
while(scanf("%d",&n)!=EOF){
while(n>4){
n-=n%5;
a+=n/5;
n/=5;
}
printf("%d\n",a);
a=0;
}
}
可以n-=n%5;移到外面的迴圈,會更快一點點