Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: punzacp555
Problemset: จับคู่เลขมงคล
Language: cpp
Time: 0.002 second
Submitted On: 2026-09-30 10:20:00
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
int a[n];
for(int& x : a) cin >> x;
int tg;
cin >> tg;
bool check = 0;
for(int i=0; i<n; i++) {
for(int j=i+1; j<n; j++) {
if(a[i]+a[j] == tg) {
cout << a[i] << ' ' << a[j] << "\n";
check = 1;
}
}
}
if(!check) cout << "No\n";
return 0;
}