整理了一下有关任意两个数字的比较大小问题,初学必看

      计算机与编程 2007-4-25 14:02:00

//2002.09.01.this is my first programme about compare 2 nums

#include <iostream.h>
#include <time.h>

main()

{
cout<<endl;
cout<<"**************************************************"<<endl;
cout<<"please input 2 nums to compare which one is big..."<<endl<<endl;
long int x,y;
cout<<"please input the x.value: "<<endl;
cin>>x;
cout<<"please input the y.value: "<<endl;
cin>>y;

long int z;
if (x>y)
{
z=x;
}
else
{
z=y;
}

cout<<endl;
cout<<"the big one is: "<<z<<endl<<endl;

cout<<"do you want to exit?"<<endl;
char BB;
cin>>BB;
return 0;


}

标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}