写一个函数,实现功能——求和
#include<stdio.h>
int func(int x,int y)
{
int s;
s=x+y;
return s;
}
void main()
{
int x,y,sum;
scanf("%d %d",&x,&y);
sum = func(x,y);
printf("%d\n",sum);
}
函数求和,小菜一碟!
写一个函数,实现功能——求和
#include<stdio.h>
int func(int x,int y)
{
int s;
s=x+y;
return s;
}
void main()
{
int x,y,sum;
scanf("%d %d",&x,&y);
sum = func(x,y);
printf("%d\n",sum);
}
函数求和,小菜一碟!