You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, July 27th 2008, 6:02pm

Kleines Problem...

Wie kann man machen das sich ein Programm erst beendet wenn man es Richtig ausführt?

2

Sunday, July 27th 2008, 7:08pm

Du meinst doch nicht das gleiche:
Das Programm schließt sich immer!!!
oder :?:

MfG bccfan

3

Sunday, July 27th 2008, 7:43pm

Nein ich meine, dass man das Programm richtig ausführen muss bevor es sich sließt und immer wiederholt wen man es nicht richtig macht...

4

Sunday, July 27th 2008, 8:12pm

Dafür gibt es doch Wiederholungsstrukturen.

C/C++ Quellcode

1
2
3
4
5
6
7
8
9
10
11
#include <iostream> 
#include <ostream>
 
int main() {
    std::cout << "Eingabe:\n";
    std::cin >> input;
    while (input != "richtige_eingabe") {
        std::cout << "Eingabe:\n";
        std::cin >> input;      
    }
}


PS: Code ist improvisiert, da ich eigentlich kein C++ kann.

Social bookmarks