题目链接:http://www.codeforces.com/problemset/problem/148/A
题意:求1到d中有多少个数能被k,l,m,n中的至少一个数整出。C++代码:#includeusing namespace std;int k, l, m, n, d, ans;int main(){ cin >> k >>l >> m >> n >> d; for (int i = 1; i <= d; i ++) if (i % k == 0 || i % l == 0 || i % m == 0 || i % n == 0) ans ++; cout << ans; return 0;}