[C++] Programmier Problem

XtaiN

Lt. Junior Grade
Registriert
Dez. 2008
Beiträge
340
Hallo,

ich habe heute angefangen mich mit c++ auseinanderzusetzen und eine paar Programme erfolgreich geschrieben.
Ich habe unteranderem ein Vokabel lern programm geschrieben, doch da ist ein Fehler:
expected declaration before '}' token.
hier ist das programm:



#include <cstdlib>
#include <iostream>
#include <string>
#include <conio.h>
#include <windows.h>
#include <wincon.h>



using namespace std;

int main()
{
string Name, eat, aussage, one, two, three, run;

system ( "color 50");
system ( "color 00");
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " Herzlich Willkommen zu meinem VOKABELLERNPORGRAMM "<<endl;
cout << " Welcome to my VOCABULARY LEARNING PROGRAM"<<endl;

Sleep (2000);
cout <<" Bitte gib deinen Namen ein " << endl;
cout <<" Please write your name down" << endl;
cin>> Name;
cout << " " << endl;

cout << " Dann zeig mal was du kannst" << " " << Name << endl;
Sleep (2000);
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout <<" Unit 1" << endl;
cout << " Uebersetze ins Deutsche" << endl;
cout << " Schreibe alles klein und ohne Umlaute" << endl;
Sleep(2500);

cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
cout << " " << endl;
{
cout << " crime" << endl;
cin>> one;
if ( ( one == "verbrechen " || one == "....." ) )

{
cout << " Gut gemacht!!!" << endl;
}
else
{
cout << " Versuchs nochmal!!!" << endl;
cout << " crime" << endl;
cin >> one;
if ( ( one == "verbrechen" || one == "....." ) )

{
cout << " Gut gemacht!!!" << endl;
}
else
{
cout << " Versuchs nochmal!!!" << endl;
cout << " crime" << endl;
cin >> one;
if ( ( one == "verbrechen" || one == "....." ) )
{
cout << " Gut gemacht!!!" << endl;
}
;}
}
}
}
} <---- da ist der fehler !!
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
{
............
 
Wofür schreibst du dutzende schließende Klammern? Du musst nur die Klammern schließen die du auch aufgemacht hast. ;)
 
Sobald ich aber weniger Klammern setze d.h. die ide ich aufgemacht habe zu, dann kommen nur noch etliche Fehler wie
expected unqualified-id before '{' token
expected `,' or `;' before '{' token
expected declaration before '}' token

Könnte mir jmd das" richtig stellen", wenn ich den ganzen code hier rein kopiere ?
 
Zuletzt bearbeitet:
Nutze mal eine vernünftige Einrückung. Dann siehst du besser, wo Klammern hingehören und wo nicht.
 
Was auf den blick auffällt:
cout << " " << endl;
{ <----------Diese Klammer kann weg
cout << " crime" << endl;

;} Das Semikolon am Ende muss auch weg

Und sonst darauf achten das auch nur die Klammern schliesst die auch aufgemacht hast.
 
habe ich gemacht, doch trotzdem nützt es nichts!!

Kann mal bitte jmd drüber gucken und evtl. eiun paar sachen verbessern bitte?


Code:
    #include <cstdlib>
    #include <iostream>
    #include <string>
    #include <conio.h>
    #include <windows.h>
    #include <wincon.h>
    
    
    
    using namespace std;
    
    int main()
    {
        string Name, eat, aussage, one, two, three, run;
        
        system ( "color 50");
        system ( "color 00");
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << "        Herzlich Willkommen zu meinem VOKABELLERNPORGRAMM "<<endl;
        cout << "        Welcome to my VOCABULARY LEARNING PROGRAM"<<endl;
        
        Sleep (2000);
        cout <<" Bitte gib deinen Namen ein " << endl;
        cout <<" Please write your name down" << endl;
        cin>> Name;
        cout << " " << endl;
    
        cout << " Dann zeig mal was du kannst" << " " << Name << endl;
        Sleep (2000);
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout <<" Unit 1" << endl;
         cout << "                    Uebersetze ins Deutsche" << endl;
        cout << "                    Schreibe alles klein und ohne Umlaute" << endl;
        Sleep(2500);
        
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
        cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    {
    cout << "              crime" << endl;
        cin>> one;
        if ( ( one == "verbrechen " || one == "....." ) )
    
    {
        cout << "                    Gut gemacht!!!" << endl;
    }  
    else        
    { 
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "             crime" << endl;
         cin >>                 one;
         if ( ( one == "verbrechen" || one == "....." ) )
        
    {
        cout << "                    Gut gemacht!!!" << endl;
    }   
    else        
    { 
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "             crime" << endl;
         cin >>                 one;
         if ( ( one == "verbrechen" || one == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }  
    }
    }
    }
    }  
    
    {                                [COLOR="Red"]<----FEHLER (gleich 2stk.)[/COLOR]
        cout << "                    during" <<endl;
        cin >> two;
        if ( ( two == "während" || two == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    ;else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    during" << endl;
        cin >>                  one;
        if ( ( two == "während" || two == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }    
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    during" << endl;
        cin >>                  one;
        if ( ( two == "während" || two == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }
    }
     
    {  [COLOR="Red"]<----FEHLER (gleich 2stk.)[/COLOR]
         cout << "                   except" << endl;
         cin >> three;
         if ( ( three == "ausser" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    except" << endl;
        cin >>three;
        if ( ( three == "ausser" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    except" << endl;
        cin>>three;
        if ( ( three == "ausser" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }   
    }   
    {   [COLOR="Red"]<----FEHLER (gleich 2stk.)[/COLOR]
        cout << "                    seat" <<endl;
        cin >> two;
        if ( ( two == "sitzplatz" || two == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    seat" << endl;
        cin >>                  one;
        if ( ( two == "sitzplatz" || two == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }    
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    seat" << endl;
        cin >>                  one;
        if ( ( two == "sitzplatz" || two == "....." ) )
        
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    
    }
    }
    }
    }   [COLOR="Red"]<----FEHLER (gleich 2stk.)[/COLOR]
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    
    }    
    {  
         cout << "                   progress (Singular)" << endl;
         cin >> three;
         if ( ( three == "fortschritt" || three == ".....") )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    progress (Singular)" << endl;
        cin >>three;
        if ( ( three == "fortschritt" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    progress (Singular)" << endl;
        cin >>three;
        if ( ( three == "fortschritt" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }    
    {  
         cout << "                   immigrant (mask.)" << endl;
         cin >> three;
         if ( ( three == "einwanderer" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                     immigrant (mask.)" << endl;
        cin >>three;
        if ( ( three == "einwanderer" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    immigrant (mask.)" << endl;
        cin>>three;
        if ( ( three == "einwanderer" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }      
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }    
    {  
         cout << "                   persecution" << endl;
         cin >> three;
         if ( ( three == "verfolgung" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    persecution" << endl;
        cin>>three;
        if ( ( three == "verfolgung" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    persecution" << endl;
        cin >>three;
        if ( ( three == "verfolgung" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }    
    {  
         cout << "                   poverty " << endl;
         cin >> three;
         if ( ( three == "armut" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    poverty " << endl;
        cin >>three;
        if ( ( three == "armut" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    poverty" << endl;
        cin >>three;
        if ( ( three == "armut" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }    
    {  
         cout << "                   marital status" << endl;
         cin >> three;
         if ( ( three == "familienstand" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    martial status " << endl;
        cin >>three;
        if ( ( three == "familienstand" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    marital status " << endl;
        cin>>three;
        if ( ( three == "familienstand " || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }          
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
       
    {  
         cout << "                   recite " <<endl;
         cin >> three;
         if ( ( three == "rezitieren" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    recite " << endl;
        cin >>three;
        if ( ( three == "rezitieren " || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    recite" << endl;
        cin>>three;
        if ( ( three == "rezitieren " || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    {  
         cout << "                   prayer" << endl;
         cin >> three;
         if ( ( three == "gebet" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    prayer" << endl;
        cin>> three;
        if ( ( three == "gebet" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    prayer" << endl;
        cin >>three;
        if ( ( three == "gebet" || three == "....." ) ) 
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    {  
         cout << "                   performing arts" <<endl;
         cin >> three;
         if ( ( three == "darstellende künste" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    performing arts" << endl;
        cin>>three;
        if ( ( three == "darstellende künste" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    performing arts" << endl;
        cin>>three;
        if ( ( three == "darstellende künste" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    {  
         cout << "                   taste" << endl;
         cin >> three;
         if ( ( three == "schmecken" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    taste" << endl;
        cin >>three;
        if ( ( three == "schmecken" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    taste" << endl;
        cin >>three;
        if ( ( three == "schmecken" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    {  
         cout << "                   in general" << endl;
         cin >> three;
         if ( ( three == "im allgemeinen" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    in general" << endl;
        cin >>three;
        if ( ( three == "im allgemeinen" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    in general" << endl;
        cin >>three;
        if ( ( three == "im allgemeinen" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    {  
         cout << "                   subway" << endl;
         cin >> three;
         if ( ( three == "u- bahn" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    subway" << endl;
        cin>>three;
        if ( ( three == "u- bahn" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    } 
    else
    {
        cout << "                    Versuchs nochmal!!!" << endl;
        cout << "                    subway" << endl;
        cin >>three;
        if ( ( three == "u- bahn" || three == "....." ) )
    {
        cout << "                    Gut gemacht!!!" << endl;
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    }
    {  
         cout << "                   to be made of" << endl;
         cin >> three;
         if ( ( three == "bestehen aus" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
     {  
         cout << "                    Versuchs nochmal!!!" << endl;
         cout << "                   to be made of" << endl;
         cin >> three;
         if ( ( three == "bestehen aus" || three == ".....") )
    {
         cout << "                   Gut gemacht!!!" << endl;
    }
    else
     {  
         cout << "                    Versuchs nochmal!!!" << endl;
         cout << "                   to be made of" << endl;
         cin >> three;
         if ( ( three == "bestehen aus" || three == "....." ) )
    {
         cout << "                   Gut gemacht!!!" << endl;
    
    
             
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
    }   
  
.......................
    
    
    cout << "                        ENDE!!!!" << endl;
    
    
        
        getch();
        return 0;
    
    }


mit oder ohne dies besteht ein Fehler!!!
cout << " " << endl;
{ <----------Diese Klammer kann weg
cout << " crime" << endl;
 
Zuletzt bearbeitet:
Ei ei ei, was machst du da? Bevor du noch mehr Klammern setzt, bitte schau dir weitere Kontrollstrukturen (while, for,...) an.

Der Code in deinem ersten Beitrag sollte so formatiert und geklammert sein (ohne Änderung oder Anmerkung der Sinnhaftigkeit desselben):

Code:
#include <stdlib.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include <conio.h>
#include <windows.h>
#include <wincon.h>

using namespace std;

int main(int argc, char** argv) {

    string Name, eat, aussage, one, two, three, run;

    system ( "color 50");
    system ( "color 00");
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " Herzlich Willkommen zu meinem VOKABELLERNPORGRAMM "<<endl;
    cout << " Welcome to my VOCABULARY LEARNING PROGRAM"<<endl;

    Sleep (2000);
    cout <<" Bitte gib deinen Namen ein " << endl;
    cout <<" Please write your name down" << endl;
    cin>> Name;
    cout << " " << endl;

    cout << " Dann zeig mal was du kannst" << " " << Name << endl;
    Sleep (2000);
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout <<" Unit 1" << endl;
    cout << " Uebersetze ins Deutsche" << endl;
    cout << " Schreibe alles klein und ohne Umlaute" << endl;
    Sleep(2500);

    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " " << endl;
    cout << " crime" << endl;
    cin>> one;
    if ( ( one == "verbrechen " || one == "....." ) )
    {
        cout << " Gut gemacht!!!" << endl;
    }
    else
    {
        cout << " Versuchs nochmal!!!" << endl;
        cout << " crime" << endl;
        cin >> one;
        if ( ( one == "verbrechen" || one == "....." ) )
        {
            cout << " Gut gemacht!!!" << endl;
        }
        else
        {
            cout << " Versuchs nochmal!!!" << endl;
            cout << " crime" << endl;
            cin >> one;
            if ( ( one == "verbrechen" || one == "....." ) )
            {
                cout << " Gut gemacht!!!" << endl;
            }
        }
    }
    return (EXIT_SUCCESS);
}

Hier siehst du, wann eine Klammer geöffnet wird und wann sie geschlossen werden muss.
In deinem Fall:
if ( bedingung ) {
[...block... ]
}
 
Kannst auch deine Abfragen in eine do-while schleife rein stecken
do {
cin>>one

if ( one == "verbrechen")
{
cout << " Gut gemacht!!!" << endl;
}else{
cout << "Versuchs nochmal" << endl;
cout << "Crime" << endl;
}
}while(one != "verbrechen");
 
Allerdings kann man auch Klammern setzten, wenn man einen extra "Sektor" haben will. ;x
Im Prinziep passiert bei IF's ja nichts anderes.

Code:
int main()
{
  {
    int j = 1;
  }
  for(int i = 0; i < j; i++) // Error ;)
     cout<<"Bla";
}
 
Zurück
Oben