Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int in, out = 0, n;
- bool b;
- cin >> n;
- for (int j = 0; j < n; j++) {
- cin >> in;
- b = in <= 1 ? false : true;
- for (int i = 2; i <= in / 2; i++) {
- if (in % i == 0) b = false;
- }
- if (b) out++;
- }
- cout << out;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement