Advertisement
borsha06

Untitled

Mar 18th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     long  int i,j,n,k,a[100],c;
  6.     cin>>n>>k;
  7.  
  8.     for(i=0; i<n; i++)
  9.     {
  10.         cin>>a[i];
  11.     }
  12.     c=0;
  13.     for(i=0; i<n; i++)
  14.     {
  15.         if((a[i]>0) && (a[i]>=a[k]))
  16.             c++;
  17.     }
  18.     cout<<c<<endl;
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement