两个数相加:
#include<stdio.h> int sum(int x,intc y); int main() { int a,b; scanf("%d,%d",&a,&b); printf("%d和%d的和是%d",a,b,sum(a,b)); return 0; } int sum(int x,int y) { int sum; sum=x+y; return sum; }
输出
#include<stdio.h> int sum(int x,intc y); int main() { int a,b; scanf("%d,%d",&a,&b); printf("%d和%d的和是%d",a,b,sum(a,b)); return 0; } int sum(int x,int y) { int sum; sum=x+y; return sum; }
输出