Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Karatat007
Problemset: จับคู่เลขมงคล
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-03 15:53:28
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n,l;
cin >> n;
int arr[n];
bool have = false;
for(int i = 0;i < n;++i){
cin >> arr[i];
}
cin >> l;
for(int i = 0;i < n;++i){
for(int j = i + 1;j < n;++j){
if(arr[i] + arr[j] == l){
cout << arr[i] << ' ' << arr[j] << '\n';
have = true;
}
}
}
if(!have) cout << "No";
}