#include<bits/stdc++.h>
using namespace std;
int main(){
int a;
ios::sync_with_stdio(false);
cin.tie(0);
while(cin>>a){
if(!a)break;
int b,c;
cin>>b>>c;
while(a--){
int d,e;
cin>>d>>e;
if(d==b||e==c){
cout<<"divisa"<<endl;
}
else if(d<b&&e>c){
cout<<"NO"<<endl;
}
else if(d<b&&e<c){
cout<<"SO"<<endl;
}
else if(d>b&&e>c){
cout<<"NE"<<endl;
}
else cout<<"SE"<<endl;
}
}
}
#include<bits/stdc++.h>
using namespace std;
int main(){
int a;
ios::sync_with_stdio(false);
cin.tie(0);
while(cin>>a){
if(!a)break;
int b,c;
cin>>b>>c;
while(a--){
int d,e;
cin>>d>>e;
if(d==b||e==c){
cout<<"divisa"<<endl;
}
else if(d<b&&e>c){
cout<<"NO"<<endl;
}
else if(d<b&&e<c){
cout<<"SO"<<endl;
}
else if(d>b&&e>c){
cout<<"NE"<<endl;
}
else cout<<"SE"<<endl;
}
}
}
你加上cout.tie(0)看看
#include<bits/stdc++.h>
using namespace std;
int main(){
int a;
ios::sync_with_stdio(false);
cin.tie(0);
while(cin>>a){
if(!a)break;
int b,c;
cin>>b>>c;
while(a--){
int d,e;
cin>>d>>e;
if(d==b||e==c){
cout<<"divisa"<<endl;
}
else if(d<b&&e>c){
cout<<"NO"<<endl;
}
else if(d<b&&e<c){
cout<<"SO"<<endl;
}
else if(d>b&&e>c){
cout<<"NE"<<endl;
}
else cout<<"SE"<<endl;
}
}
}
你加上cout.tie(0)看看
然後endl換成"\n" 或改用scanf(),printf()