Created
April 9, 2023 18:51
-
-
Save estelabn/6db64e5c706c55bebf001bec8d51d7c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int n,a,d; | |
cin >> n >> a >> d; | |
int res = 0; | |
for(int i=0; i<n; i++){ | |
int m; cin >> m; | |
int difAtual = abs(m - a); | |
if(difAtual <= d) res++; | |
} | |
cout << res << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment