Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: nunos

Problemset: จับคู่เลขมงคล

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-03 16:50:58

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;cin>>n;
    int d[n];
    int lucky=0;
    bool no=false;
    for(int i=0;i<n;i++) cin >> d[i];
    cin >> lucky;
    for(int i=0;i<n;i++){
        for(int j=i;j<n;j++){
            if(i!=j && (d[i]+d[j])==lucky){
                cout << d[i] << " " << d[j] <<"\n";
                no =true;
            }
        }
    }
    if(!no) cout <<"No";
    return 0;
}