事件推送[(https://www.online1987.com/事件推送/)]
#include<iostream>
#include<vector>
using namespace std;
int main() {
int m = 0;
int n = 0;
int r = 0;
cin >> m >> n >> r;
vector<int> setA(m , 0);
vector<int> setB(n , 0);
for (int i = 0; i < m; ++i) {
cin >> setA[i];
}
for (int i = 0; i < n; ++i) {
cin >> setB[i];
}
int pa = 0;
int pb = 0;
while (pa < m&&pb<n) {
if (setB[pb] - setA[pa] >= 0 && setB[pb] - setA[pa] <= r) {
cout << setA[pa++] << ' ' << setB[pb++] << endl;
}
else ++pb;
}
return 0;
}
标签:setA,setB,int,cin,pa,事件,推送
From: https://www.cnblogs.com/chunbai11/p/16744655.html