2019-03-15 22:20发布
#include<stdio.h>
void main()
{
double a,b,c,s,v;
printf("Input a,b,c: ");
scanf("%d%d%d",&a,&b,&c);
s=a*b+b*c+a*c;
v=a*b*c;
printf("a=%d,b=%d,c=%d ",a,b,c);
printf("s=%f ",s,"v=%d ",v);
}
#include <stdio.h>
{ float a, b, c, s, v; printf("Input a,b,c:\n"); scanf_s("%f%f%f", &a, &b, &c); s = 2 * ( a * b + b * c + a * c ); v = a * b*c; printf("a=%f, b=%f, c=%f.\n", a, b, c); printf("s=%f\n", s, "v=%f\n", v);
运行结果:
Input a,b,c:1 2 3a=1.000000, b=2.000000, c=3.000000.s=22.000000
最多设置5个标签!
#include <stdio.h>
void main()
{
float a, b, c, s, v;
printf("Input a,b,c:\n");
scanf_s("%f%f%f", &a, &b, &c);
s = 2 * ( a * b + b * c + a * c );
v = a * b*c;
printf("a=%f, b=%f, c=%f.\n", a, b, c);
printf("s=%f\n", s, "v=%f\n", v);
}
运行结果:
Input a,b,c:
1 2 3
a=1.000000, b=2.000000, c=3.000000.
s=22.000000
一周热门 更多>