Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 263 → Rev 262

/programy/C/cykly/cykly.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programy/C/cykly/cykly.c
File deleted
/programy/C/opis/opis.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programy/C/opis/opis.c
File deleted
/programy/C/nahoda/nahoda.c
File deleted
/programy/C/nahoda/nahoda.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programy/C/rovnice/rovnice.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programy/C/rovnice/rovnice.c
7,34 → 7,20
printf("program vyresi rovnici ve tvaru Ax^2 + Bx + C = 0");
// zadej hodnoty
printf("\n Zadej hodnotu A= ");
scanf("%d",&a);
scanf("%f",&a);
printf("\n Zadej hodnotu B= ");
scanf("%d",&b);
scanf("%f",&b);
printf("\n Zadej hodnotu C= ");
scanf("%d",&c);
scanf("%f",&c);
if(a==0)
{
if(b==0) printf("rovnice nema reseni."); // rovnice je neresitelna
else printf("X=%f",-(float)c/b ); // jedna se o linearni rovnici
if(b==0) printf("rovnice nema reseni v realnych cislech"); // rovnice je neresitelna
else printf("X=%d",(-c/b)); // jedna se o linearni rovnici
}
else
{ // rovnice ma reseni
d=((b*b)-(4*a*c));
printf("\n discriminant rovnice D=%d",d);
if (d>0)
{
printf("\n rovnice ma reseni X1=%f X2=%f",( ((float)-b)+sqrt(d))/2*a,((float)-b)-sqrt(d))/2*a;
}
if (d==0)
{
printf("\n rovnice ma jeden koren X=%f",(((float)-b)/2*a));
}
if (d<0)
{
printf("\n reseni rovnice lezi v rovine komplexnich cisel.");
printf("\n X1=%f X2=%f");
}
d=sqrt(b*b-4*a*c);
printf("discriminant rovnice D=%f",d);
}
}