《C语言程序设计》实验1
1-6 计算和与差
Problem Description
从键盘输入两个整型变量的值,计算并输出它们的和与差。
Input
两个整数。
Output
两个整数的和和两个整数的差,中间用逗号分隔
Sample Input
3 5
Sample Output
8,-2
#include <stdio.h>
#include <stdlib.h>
int main()
{ int a,b,c,d;
scanf("%d %d",&a,&b);
c=a+b;
d=a-b;
printf("%d,%d",c,d);
return 0;
}