刚学C,编了个小程序出错了,请大神帮忙看一下。

知道长方形的长和宽,求面积和周长
#include
main()
{
float x,y,a,b;
printf ("请输入长和宽且用逗号分隔:);
scanf ("%f,%f,&x,&y);
a=x*y;
b=(x+y)*2;
printf ("面积=%f,周长=%f\n",a,b);
}

  1. 错误一:include后面缺少头文件包含
  2. 错误二:printf中没有右半边的引号
  3. 错误三:scanf中没有右半边的引号
 #include <stdio.h>
 main()
 {
        float x,y,a,b;
        printf("Please input length and width of rectangle with comma divided:");
        scanf("%f,%f",&x,&y);
        a = x * y;
        b = ( x + y ) * 2;
        printf(" area = %f, girth = %f", a, b);

提示的什么错误呢?给个明确的

printf("请输入长和宽且用逗号分隔:");printf ("面积=%f,周长=%f\n",a,b);引号要双的,书写习惯不好

scanf ("%f",&x);
scanf ("%f",&y);

读取字符串一行一行读取

scanf ("%f,%f",&x,&y);
少了个引号吧

printf ("请输入长和宽且用逗号分隔:); ------->>>> printf ("请输入长和宽且用逗号分隔:");
scanf ("%f,%f,&x,&y); ------->>>> scanf ("%f,%f",&x,&y);

  1. 错误一:include后面缺少头文件包
  2. 错误二:printf中没有右半边的引号
  3. 错误三:scanf中没有右半边的引号
  #include <stdio.h>
 main()
 {
        float x,y,a,b;
        printf("Please input length and width of rectangle with comma divided:");
        scanf("%f,%f",&x,&y);
        a = x * y;
        b = ( x + y ) * 2;
        printf(" area = %f, girth = %f", a, b);
}

语句printf ("请输入长和宽且用逗号分隔:);和scanf ("%f,%f,&x,&y);的左边都少了双引号
头文件也有问题,应该是:#include
int main()
{
}