...个整数相加和两个小数相加后相乘,并显示两数相乘的结果 拜托各位帮...
发布网友
发布时间:2024-05-06 11:43
我来回答
共5个回答
热心网友
时间:2024-05-29 07:38
#include<stdio.h>
main()
{
int a,b;
float m,n,sum;
printf("请输入两个整数:\n");
scanf("%d,%d",&a,&b);
printf("请输入两个小数:\n");
scanf("%f,%f",&m,&n);
sum=(a+b)*(m+n);
printf("(%d+%d)*(%f+%f)=%f\n",a,b,m,n,sum);
}
热心网友
时间:2024-05-29 07:37
#incude <stdio.h>
void main()
{
int a, b;
double c, d,e; printf("请输入两个整数和两个小数a,b,c,d:"); e=(a + b) * (c + d);
scanf("%d,%d,%lf,%lf,", &a, &b, &c, &c);
printf("%f\n", e );}
热心网友
时间:2024-05-29 07:42
#include <stdio.h>
void main()
{int a= ,b= ,e ;
float c= ,d=, f,g;
e=a+b;
e=a+b;
f=c=d;
e*f=g;
printf("g=%d\n",g);}
热心网友
时间:2024-05-29 07:45
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a = 1 ;
int b = 2;
float c = 1.0;
float d = 2.0;
printf("%f\n",(a+b)*(c*d));//整数和浮点数相乘会隐式转化成浮点数;
return 0;
}
热心网友
时间:2024-05-29 07:43
#incude <stdio.h>
int main(void)
{
int a, b;
double c, d;
scanf("%d%d%lf%lf", &a, &b, &c, &c);
printf("%f\n", (a + b) * (c + d));
return 0;
}