LZ写的其实不是C++......那是纯C代码.....
我改成用C++的版本:
#include <iostream>
using namespace std;
int main()
{
int x, y;
cout<<"Input your age: "<<endl;
cin>>x;
cout<<"Input your brother's age: "<<endl;
cin>>y;
if (x<y)
{
cout<<"Your age is "<<x<<", your brother's age is "<<y<<"."<<endl;
cout<<"Your brother is older than you!"<<endl;
}
else if (x>y)
{
cout<<"You are older than your brother!"<<endl;
}
else
{
cout<<"Both guys have the same age!"<<endl;
}
cout<<"Goodbye!"<<endl;
return 0;
}