Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n, k, a[100];
- cout << "Nhap n: ";
- cin >> n;
- cout << "Nhap k: ";
- cin >> k;
- for (int i = 0; i < n; i++) {
- cout << "Nhap a[" << i << "] = ";
- cin >> a[i];
- }
- int cnt = 0;
- for (int i = 0; i < n; i++) {
- if (a[i] % k == 0) cnt++;
- }
- cout << "So so la boi cua k: " << cnt;
- }
Advertisement
Add Comment
Please, Sign In to add comment