XandreasrektsX

Untitled

Oct 12th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8. int N,M,K,a,c=0;
  9.  
  10. vector<int> V1;
  11. vector<int> V2;
  12.  
  13. cin >> N >> M >> K;
  14.  
  15. for(int i = 0; i<N; i++){
  16. cin >> a;
  17. V1.push_back(a);
  18. }
  19.  
  20. for(int i = 0; i<M; i++){
  21. cin >> a;
  22. V2.push_back(a);
  23. }
  24.  
  25. for(int i = 0; i<N; i++){
  26. for(int j = 0; j<M; j++){
  27. if(V1[i] - V2[j] <= 5 && V1[i] - V2[j] >= -5){
  28. c++;
  29. V2[j] == -50;
  30. V1[i] == -100;
  31. }
  32.  
  33. }
  34.  
  35. }
  36.  
  37. cout << c;
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment