#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
long long int n;
cin>>n;
int count = 0;
while(n > 5){
n = n/5;
count += n;
}
cout<<count<<endl;
}
return 0;
}
What is wrong in the above code !? Please reply
Link to the problem
2 Likes
Before anyone answers, please format your code, link the problem, etc.
instead of while(t–) it should be while(t--)
@adi_m1997
They actually wrote it correctly, but the forum screwed it up
3 Likes
You should still format your code, link the problem, etc. though
2 Likes
Awesome! Try n = 5 and that should be enough insight to find the bug.
4 Likes
Ohhkay…so the condition should be :
while(n >= 5)
2 Likes