Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: MrPian
Problemset: จับคู่เลขมงคล
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-03 19:14:39
#include<iostream>
using namespace std;
int main(){
int x,lim;
cin >> x;
int y[x];
bool have = false;
for(int i=0;i<x;i++){
cin >> y[i];
}
cin >> lim;
for(int i=0;i<x;i++){
for(int j=i;j<x;j++){
if(y[i]+y[j]==lim){
if(i!=j){
cout << y[i] << " " << y[j] << endl;
have = true;
}
}
}
}if(!have) cout << "No";
return 0;
}