codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <string> using namespace std; int rechner(int geldbetrag, int kurs, int ergebnis); int main() { // VARIABLEN string stSpielername; int nAuswahl = 0; while (nAuswahl != 3) { cout << endl; cout << " =============" << endl; cout << " SPIEL-MENU" << endl; cout << " =============\n" << endl; cout << " => [1] Spiel starten" << endl; cout << " => [2] Anleitung" << endl; cout << " => [3] Gramm-Rechner" << endl; cout << " => [3] Beenden\n" << endl; cout << " => AUSWAHL: "; cin >> nAuswahl; if (nAuswahl == 1) // Spiel starten { system("CLS"); cout << "Starte Spiel..." << endl; } else if (nAuswahl == 2) // Anleitung { system("CLS"); cout << "Spiel einfach..." << endl; } else if (nAuswahl == 3) // Rechner { system("CLS"); int rechner (int geldbetrag, int kurs, int ergebnis); } else if (nAuswahl == 4) // Beenden { system("CLS"); cout << "Beenden..." << endl; } else { system("CLS"); cout << "FALSCHE EINGABE!!! ERROR ERROR ERROR!!!" << endl; } } getchar(); return 0; } int rechner (int geldbetrag, int kurs, int ergebnis) { cout << " => Geldbetrag: "; cin >> geldbetrag; cout << endl; cout << " => Kurs: "; cin >> kurs; cout << endl; ergebnis = geldbetrag / kurs; cout << " => Du erhaelst " << ergebnis << " Gramm zum Rauchen!" << endl; cout << endl; }
Private
[
?
]
Run code
Submit