函数的声明和定义

#include <iostream>
using namespace std;
int area(int a,int b);
void main(){
int A,B,C;
 cin>>A;
 if(A<100)
  cout<<"a less 100.\n";
 cin>>B;
 if(B)    // 等价于 if(B!=0)
  cout<<"B is number.\n";
 C=area(A,B);
 cout<<"A * B is "
  <<C;
}
int area(int a,int b){
return a*b;
}
posted @ 2008-11-05 15:58  雨城  阅读(315)  评论(0编辑  收藏  举报