SHARE
TWEET

Untitled

a guest Oct 20th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top