Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int arr[100];
- int main()
- {
- int n, se;
- cin >> n >> se;
- for(int i = 0; i < n; ++i)
- {
- cin >> arr[i];
- }
- int res = 0;
- for (int i = 0; i < n; ++i)
- {
- if(arr[i] >= arr[se-1] && arr[i] != 0)
- ++res;
- }
- cout << res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement