wrench786

Lab task - (Array - 4)

Oct 7th, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define ll long long
  4. #define ull unsigned long long
  5. #define uom unordered_map
  6. #define pb push_back
  7. #define yes cout<<"YES\n"
  8. #define no cout<<"NO\n"
  9.  
  10. #define dot(x) fixed<<setprecision(x)
  11. #define wrench786 ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  12.  
  13. #define PI (acos(-1.0))
  14. #define eps 0.00001
  15. const int LIMIT = 10000*500;
  16. const int mod = 1000000007;
  17. using namespace std;
  18.  
  19. int main(){
  20. int n,i,x;
  21. cin>>n;
  22. int arr[n];
  23.  
  24. for(i=0;i<n;i++){
  25. cin>>arr[i];
  26. }
  27.  
  28. cin>>x;
  29. int co=0;
  30.  
  31. for(i=0;i<n;i++){
  32. if(arr[i]==x) co++;
  33. }
  34.  
  35. cout<<x<<" is found "<<co<<" times in your list"<<endl;
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment