新人求助!missing ';' before 'type'错在哪了?找不到啊
#include<stdio.h>#include<math.h>
void xz();
void pd();
float x,x1,x2,a,b,c,n;
void main()
{
scanf("%f,%f,%f",&a,&b,&c);
pd();
xz();
}
void xz()
{
switch (n)
{
case 1: printf("不是二次函");break;
case 2:x=-b/(a*2);printf("%8.4f\n",x);break;
case 3:x1=-b/(2*a)-sqrt(b*b-4*a*c)/(2*a);x2=-b/(2*a)+sqrt(b*b-4*a*c)/(2*a);
printf("%8.4f,%8.4f\n",x1,x2);break;
case 4:x1=-b/(2*a)-sqrt(b*b-4*a*c)/(2*a);
x2=-b/(2*a)+sqrt(b*b-4*a*c)/(2*a);printf("%8.4fi,%8.4fi\n",x1,x2);break;
}
void pd()
{
if(a==0)
n=1;
else
if(b*b-4*a*c==0)
n=2;
else
if(b*b-4*a*c>0)
n=3;
else
n=4;
}