2018 第九届蓝桥杯省赛总结 + 解题报告(C语言B组)3.乘积尾零

#include 
using namespace std;
int main()
{
	#ifdef ONLINE_JUDGE
	#else
	freopen("in.txt", "r", stdin);
	#endif
	
	int c2 = 0, c5 = 0;
	int N;
	int i;
	
	for(i = 0; i < 100; i++){
		cin >> N;
		
		while(N % 2 == 0){
			N /= 2;
			c2++;
		}
		while(N % 5 == 0){
			N /= 5;
			c5++;
		}
	}
	
	cout << min(c2, c5);
	return 0;
}

你可能感兴趣的:(蓝桥杯)