#include <stdio.h>
int main()
{
int num1 = 0;
int num2 = 0;
printf("输入两个整数,用逗号隔开:");
scanf_s("%d,%d", &num1, &num2);//&表示取地址符号
printf("num1=%d\n", num1);
printf("num2=%d\n", num2);
int sum = num1 + num2;
printf("sum=%d", sum);
return 0;
}
#include <stdio.h>
int main()
{
int num1 = 0;
int num2 = 0;
printf("输入两个整数,用逗号隔开:");
scanf_s("%d,%d", &num1, &num2);//&表示取地址符号
printf("num1=%d\n", num1);
printf("num2=%d\n", num2);
int sum = num1 + num2;
printf("sum=%d", sum);
return 0;
}