#include
using namespace std;
unsigned short int hanshu(unsigned short int x,unsigned short int y) {
if (y==0)
cout<<"-1"<
else
return short int (x/y);
}
int main() {
unsigned short int x,y;
cout
cin>>x>>y:
cout<<"the result is"<<hanshu(x,y)<<endl;
return 0;
}
要怎麼改啊?
unsigned short int 改成 signed short int
因為unsigned short int 取值為0-65535,
signed short int取值為-32,768 到 32,767