Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int N;
  5. int K;
  6. int P;
  7. struct marks
  8. {
  9. int M;
  10. };
  11. marks Marks[100
  12. ];
  13.  
  14. int main()
  15. {
  16. cin >> N;
  17. cin >> K;
  18.  
  19. for (int i = 0; i < N; i++)
  20. {
  21. cin >> Marks[i].M;
  22. }
  23.  
  24. P = 0;
  25. for (int i = 0; i < N; i++)
  26. {
  27. if (Marks[i].M >= K)
  28. {
  29. P++;
  30. }
  31. }
  32.  
  33. cout << P;
  34.  
  35. for (int i = 0; i < N; i++)
  36. {
  37. if (Marks[i].M >= K)
  38. {
  39. cout << " " << (Marks[i].M);
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement