回复 楼主 jakexiang
#include "stdio.h"
void main ()
{
int area(int x,int y);// 在这里定义函数area
int a,b,s;
scanf("%d,%d",&a,&b);
s=area(a,b);
printf("area is %d\n",s);
}
int area(int x,int y)
{
int s;
s=x*y;
return s;
}
或者是这样的,不在main函数里面进行定义
#include "stdio.h"
int area(int x,int y)
//你将功能函数放在前面就行来了
{
int s;
s=x*y;
return s;
}
void main ()
{
int a,b,s;
scanf("%d,%d",&a,&b);
s=area(a,b);
printf("area is %d\n",s);
}