请问我的程序哪里错了.
来源:百度知道 编辑:UC知道 时间:2024/05/07 05:03:42
#include <iostream>
using namespace std;
int main()
{
cout<<"enter x and y:";
cin>>x>>y;
if(x!=y)
if(x>y)
cout<<"x>y"<<endl;
else
cout<<"x<y"<<endl;
else
cout<<"x=y"<<endl;
}
using namespace std;
int main()
{
cout<<"enter x and y:";
cin>>x>>y;
if(x!=y)
if(x>y)
cout<<"x>y"<<endl;
else
cout<<"x<y"<<endl;
else
cout<<"x=y"<<endl;
}
#include <iostream>
using namespace std;
int main()
{
int x,y;
cout<<"enter x and y:";
cin>>x>>y;
if(x!=y)
if(x>y)
cout<<"x>y"<<endl;
else
cout<<"x<y"<<endl;
else
cout<<"x=y"<<endl;
}
你再试试
x,y还没声明呢
int x,y;
#include <iostream>
using namespace std;
int main()
{
int x,y;
cout<<"enter x and y:";
cin>>x>>y;
if(x!=y)
{
if(x>y)
cout<<"x>y"<<endl;
else
cout<<"x<y"<<endl;
}
else
cout<<&q