我用的式dev-c++ 明明没有错误的程序他总是显示出错是怎么回事

来源:百度知道 编辑:UC知道 时间:2024/07/05 20:23:10
比如说这段程序
#include <iostream.h>
#include <conio.h>

int main()
{int a,b,c;
cin >> a >> b;
c=Abs(a,b);
cout << c << "\n"
getchar();
return 0;
}

int Abs(int a ,int b)
{if(a>b)
return a;
return b; }
下面显示的错误是
7 C:\Dev-Cpp\我的c++\返回最大值.cpp `Abs' undeclared (first use this function)
9 C:\Dev-Cpp\我的c++\返回最大值.cpp expected `;' before "getchar"
14 C:\Dev-Cpp\我的c++\返回最大值.cpp `int Abs(int, int)' used prior to declaration

int main()
{int a,b,c;
cin >> a >> b;
c=Abs(a,b);
cout << c << "\n"        //没有分号呀!!
getchar();
return 0;
}

Abs没有声明,另外cout语句少了个分号。大哥编绎器的提示看不懂啊

楼主有才