为什么赋值可以,输入就不行,求指教,谢谢
#include<stdio.h>#include<math.h>
void main()
{
double r1,r2,r3,Sn,Pztb,Sztb,Syt1,Pyt1,Sbmax,S1,Ub,Sab,S2,Szta,Pzta,Samax,
Syt2,S3,SAa,S4,SztA,SN2,SytA,SAmax,SFA,S6,S5,UF,UA,UAa,Ua,Uab,UB;
int U1;
Sn=31.5;
Ub=220;
r1=0.9;
r2=0.985;
r3=1.6375;
Pztb=0.148;
Pzta=0.175;
Syt2=0.092;
SytA=0.128;
Sbmax=40;
Samax=30;
SAmax=100;
SN2=120;
Sztb=2*(0.148*Sbmax*Sbmax/(4*Sn*Sn));
Pyt1=0.0385;
Syt1=2*Pyt1;
S1=Sbmax+Sztb+Syt1;
printf("节点1的潮流S1:%f\n",S1);
Sab=r3*S1*S1/(Ub*Ub);
S2=S1+Sab;
printf("节点2的潮流S2:%f\n",S2);
Szta=2*(Samax*Samax*0.175/(4*Sn*Sn));
S3=S2+Samax+Szta;
printf("节点3的潮流S3:%f\n",S3);
SAa=S3*S3*r2/Ub/Ub;
S4=S3+SAa;
printf("节点4的潮流S4:%f\n",S4);
SztA=2*(SAmax*SAmax*0.276/(4*SN2*SN2));
S5=S4+SAmax+SztA+SytA;
printf("节点5的潮流S5:%f\n",S5);
SFA=S5*S5*r1/(Ub*Ub);
S6=S5+SFA;
printf("节点6的潮流S6:%f\n",S6);
printf("输入送端电压U1:");
scanf("%d,&U1");
UF=S6*r1/U1;
UA=U1-UF;
printf("A点电压UA:%f\n",UA);
UAa=S4*r2/UA;
Ua=UA-UAa;
printf("a电压Ua%f\n",Ua);
Uab=S2*r3/Ua;
UB=Ua-Uab;
printf("b电压Ub%f\n",UB);}