Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int N;
- int K;
- int P;
- struct marks
- {
- int M;
- };
- marks Marks[100
- ];
- int main()
- {
- cin >> N;
- cin >> K;
- for (int i = 0; i < N; i++)
- {
- cin >> Marks[i].M;
- }
- P = 0;
- for (int i = 0; i < N; i++)
- {
- if (Marks[i].M >= K)
- {
- P++;
- }
- }
- cout << P;
- for (int i = 0; i < N; i++)
- {
- if (Marks[i].M >= K)
- {
- cout << " " << (Marks[i].M);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement