#include
#include <windows.h>
using namespace std;
int main(void) {
unsigned boy_age; //男孩年龄
unsigned girl_age; //女孩年龄
unsigned age; //年龄
cout << "男孩的年龄:" << endl;
cin >> boy_age;
cout << "女孩的年龄:" << endl;
cin >> girl_age;
age = boy_age - girl_age;
cout << "男孩比女孩大:" << age << "岁" << endl;
age = girl_age - boy_age;
cout << "女孩比男孩大:" << age << "岁" << endl;
system("pause");
return 0;
}
//unsigned 就是 unsigned int类型
/*
无符号数,不能表示负数!
强行用无符号数表示负数
会对该类型范围负数“补码”
*/