#include <stdio.h>
int Add(int x, int y)
{
int z = 0;
z = x + y;
return z;
}
int main()
{
int a = 0;
int b = 0;
printf("请输入两个数字:");
scanf_s("%d%d", &a, &b);
int sum = Add(a, b);
printf("sum=%d", sum);
return 0;
}
C语言:用函数写出两个数的和
![](https://img-home.csdnimg.cn/images/20240711042549.png)