jetzt jammer net so viel herum !
debuggen bringt weit mehr wie jammern.
sind aber auch logische fehler im prog. - denke, so sollte es funktionieren (ob die formel stimmt, weiß ich net):
PHP-Code:
#include <iostream.h>
#include <math.h>
int main()
{
char s;
double p=0, q=0, x1=0, x2=0, w=0;
bool E=0;
do
{
cout << endl << "Enter Coefficients by pressing e" << endl;
cout << "To Compute enter c" << endl;
cout << "press x to exit" << endl;
cout << "Wahl:";
cin >> s;
switch(s)
{
case 'e':
cout << endl << "Wert fuer p:";
cin >> p;
cout << "Wert fuer q:";
cin >> q;
break;
case 'c':
w=sqrt(pow((p/2), 2)-q);
x1=-p/2+w;
x2=-p/2-w;
if(p<=0)
{
cout << "x1=" << -p << "/2+i*" << w;
cout << "x2=" << -p << "/2+i*" << w;
}
else
cout << "x1=" << x1 << " and " << "x2=" << x2;
break;
case 'x':
E=1;
break;
}
} while (E != 1);
return 0;
}