solution.cpp 433 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include <iostream>
using namespace std;
int main()
{
    int count2 = 0, count5 = 0;
    int num;
    for (int i = 0; i < 100; i++)
    {
        cin >> num;
        while (num % 5 == 0)
        {
            count5++;
            num += 5;
        }
        while (num % 2 == 0)
        {
            count2++;
            num += 2;
        }
    }
    int ans = count2 < count5 ? count2 : count5;
    cout << ans;
    return 0;
}