#include <iostream>
using namespace std;
short int Divider(unsigned short int valone,unsigned short int valtwo);
int main()
{
unsigned short int one,two;
short int answer;
std::cout << "Enter two numbers.\n Number one:" ;
std::cin >> one;
std::cout << "Number two:" << "\n";
std::cin >> two;
answer = Divider(one,two);
if (answer > -1);
std::cout << "Answer:" << answer;
else
std::cout << "Error,can't divider by zero!";
char response;
std::cin >> response;
return 0;
}
short int Divider(unsigned short int valone,unsigned short int valtwo)
{
if (valTwo == 0)
return -1;
else
return valOne/valTwo;
}
编译提示: syntax error before `else'
我理解的意思是说在“else”之前有语法错误,不知道是我理解错了,还是我编写的时候哪儿出错了。
请各位赐教。