#include<stdio.h>
int main()
{
double a, b;
scanf("%lf %lf", &a, &b);
double c = a + b;
double d = a * b;
printf("%.3lf %.3lf", c, d);
return 0;
}
a和b是float类型,不能用%d输入,改为%f
都用float类型
float a, b, c, d;
scanf("%f %f", &a, &b);
题目中说的是读入两个实数,而不是整数,将int和float改成double,以及输入的时候格式说明为%lf
输出的时候也是一样,%.3lf