#include<bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
while(cin)
cin>>x>>y;
cout<<"YES";
}
- here for which input it will print out "YES"?
- is cout is logic 1 or 0?
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
while(cin)
cin>>x>>y;
cout<<"YES";
}
This will print "YES" for any input (except for an infinite stream of valid input, in which case it'll run forever and never print anything).
You forgot braces for your loop, so the cout statement is not actually in the loop.
Your cout is in no way conditional on the values you read in.