-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecnuoj3022.cpp
53 lines (53 loc) · 916 Bytes
/
ecnuoj3022.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include<iostream>
#include<stdio.h>
using namespace std;
int solve5(int k)
{
int res=0;
if(k>=625)
{
res=res+k/5+k/25+k/125+k/625;
}
else
{
if(k>=125)
{
res=res+k/5+k/25+k/125;
}
else
{
if(k>=25)
{
res=res+k/5+k/25;
}
else
{
if(k>=5)
{
res=res+k/5;
}
else
{
res=res;
}
}
}
}
return res;
}
int main()
{
int T=0;
scanf("%d",&T);
int countT=0;
while(T>0)
{
int k=0;
scanf("%d",&k);
printf("case #%d:\n",countT);
printf("%d\n",solve5(k));
T--;
countT++;
}
return 0;
}