WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 21.10.2003, 22:14   #11
Biri
Hero
 
Registriert seit: 04.09.2001
Beiträge: 894


Standard

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=0q=0x1=0x2=0w=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=" << -<< "/2+i*" << w;
                    
cout << "x2=" << -<< "/2+i*" << w;
                }
                else
                    
cout << "x1=" << x1 << " and " << "x2=" << x2
                break;
                
            case 
'x':
                
E=1;
                break;
        } 
    } while (
!= 1);
    
    return 
0;

Biri ist offline   Mit Zitat antworten
Alt 21.10.2003, 22:32   #12
Groovy
Inventar
 
Registriert seit: 24.01.2001
Beiträge: 5.107


Standard

Danke vielmals! Du hast mir echt weitergeholfen.
Groovy ist offline   Mit Zitat antworten
Alt 22.10.2003, 22:51   #13
Biri
Hero
 
Registriert seit: 04.09.2001
Beiträge: 894


Standard

keine ursache - das war meine "gute tat" zum gestrigen tag.

fg
-hannes
Biri ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 12:46 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag