以下是引用neukevin在2017-9-26 22:43:01的发言:
# include<stdio.h>
void main()
{
int a,b;
double c;
puts("请输入整数a和整数b的值。");
scanf("%d%d",&a,&b);
printf("a+b=%d\n",a+b);
printf("a-b=%d\n",a-b);
printf("a*b=%d\n",a*b);
printf("a/b=%d\n",a/b);
printf("a%b=%d\n",a%b);
printf("(a+b)/2=%d\n",(a+b)/2);
printf("他们的平均值是%f\n\n",(double)(a+b)/2);
printf("半径是"); scanf("%1f",&c);
printf("半径为%f的圆的面积是%f。\n",c,3.14*c*c);
}
帮忙测一下 谢谢
谢谢
#include <stdio.h>
void main()
{
int a,b;
double c;
puts("请输入整数a和整数b的值。");
scanf("%d%d",&a,&b);
printf("a+b=%d\n",a+b);
printf("a-b=%d\n",a-b);
printf("a*b=%d\n",a*b);
printf("a/b=%d\n",a/b);
printf("a%%b=%d\n",a%b);
printf("(a+b)/2=%d\n",(a+b)/2);
printf("他们的平均值是%lf\n\n",(double)(a+b)/2);
printf("半径是"); scanf("%lf",&c);
printf("半径为%lf的圆的面积是%lf。\n",c,3.14*c*c);
}