Đăng nhập để hỏi chi tiết
Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
C++
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define hutao int main()
#define it int
hutao {
ll n, x;
cin >> n >> x;
bool xuly = false;
for (int i = 0; i < n; ++i) {
ll ans;
cin >> ans;
if (ans == x) {
xuly = true;
}
}
if (xuly) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
#nguyenminhtuan477
Hãy giúp mọi người biết câu trả lời này thế nào?
\begin{array}{c} \color{#F5FAFF}{F} \color{#9EC1E9}{u} \color{#7DA6D9}{r} \color{#5C8BCD}{i} \color{#7A9CCF}{n} \color{#8BB0D9}{a} \color{#8BB0D9}{F} \color{#7A9CCF}{o} \color{#5C8BCD}{r} \color{#7DA6D9}{c} \color{#9EC1E9}{a} \color{#F5FAFF}{l} \color{#9EC1E9}{o} \color{#FFFFFF}{s} \end{array}
/**
* author: furinaforcalos
* created: 05.06.2025
**/
#include<bits/stdc++.h>
#define hutao long long
using namespace std;
hutao n,a[100005],x;
pair<hutao,hutao> d[100005];
#define task "ATM"
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
if(fopen(task".inp","r"))
{
freopen(task".inp","r",stdin);
freopen(task".out","w",stdout);
}
cin>>n>>x;
for(hutao i=1;i<=n;i++)
{
cin>>a[i];
}
hutao dem=0;
for(hutao i=1;i<=n;i++)
{
if(a[i]==x)
{
cout<<"YES";
return 0;
}
}
cout<<"NO";
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin