怎么设置一条语句使得在第五行输入数值之后可以把第七行的英文显示出来

#include<stdio.h>void main(){ double length,width,s; printf("Enter the length of the room:"); scanf("%lf尀n",&length); printf("Enter the width of the room:"); scanf("%lf尀n,&width"); s=length*width; printf("s=%d尀n",s);}怎么设置一条语句使得在第五行输入数值之后可以把第七行的英文显示出来
2026年09月23日 13:14
有2个网友回答
网友(1):

//scanf()函数不要在格式串中加\n
#include
void main()
{
double length,width,s;
printf("Enter the length of the room:");
scanf("%lf",&length); //
printf("Enter the width of the room:");
scanf("%lf",&width); //引号位置有问题
s=length*width;
printf("s=%lf\n",s); //double 用%lf (long double)
}

网友(2):

你的第五行输入语句中的引号位置错了,不应该引到最后,而且里面也不要加\n