用C++,输入两个整数,判断他们的关系(大于,小于,等于)
展开全部
#include <iostream.h>
void main(){
int i, j;
cout<<"请输入第一个整数:"<<endl;
cin>>i;
cout<<"请输入第二个整数:"<<endl;
cin>>j;
if(i>j)
cout<<i<<">"<<j<<endl;
else if(i==j)
cout<<i<<"="<<j<<endl;
else
cout<<i<<"<"<<j<<endl;
}
void main(){
int i, j;
cout<<"请输入第一个整数:"<<endl;
cin>>i;
cout<<"请输入第二个整数:"<<endl;
cin>>j;
if(i>j)
cout<<i<<">"<<j<<endl;
else if(i==j)
cout<<i<<"="<<j<<endl;
else
cout<<i<<"<"<<j<<endl;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
void main()
{
int x,y;
cin>>x;
cin>>y;
if(x > y)
cout<<x<<" is greater than "<<y<<endl;
else if(x == y)
cout<<x<<" equals to "<<y<<endl;
else
cout<<x<<" is less than "<<y<<endl;
}
{
int x,y;
cin>>x;
cin>>y;
if(x > y)
cout<<x<<" is greater than "<<y<<endl;
else if(x == y)
cout<<x<<" equals to "<<y<<endl;
else
cout<<x<<" is less than "<<y<<endl;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询