Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Zufallszahl2.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <ctime>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- srand (static_cast<unsigned int>(time(NULL)));
- int zz = rand() % 101; //zz = Zufallszahl
- int anzahl; //anzahl = Anzahl der Ratedurchgänge
- int ez; //ez = Eigene Zahl
- {
- cout << "Bitte geben Sie die Anzahl der Ratedurchgaenge ein : ";
- cin >> anzahl;
- cout << endl;
- }
- {
- for(int i = 1; i <= anzahl; i=i+1)
- {
- {
- {
- {
- cout << " Geben sie bitte ihre Zahl ein : ";
- cin >> ez;
- cout << "Das ist Durchgang: " << (i) << " ";
- if(ez > zz)
- {
- cout << "Die Zahl " << ez << " ist groesser als " << "die Zufallszahl! ";
- }
- }
- if(ez < zz)
- {
- cout << "Die Zahl " << ez << " ist kleiner als " << "die Zufallszahl! ";
- }
- }
- {
- if(ez == zz)
- cout << "Herzlichen Glückwunsch! Die Zufallszahl ist : " << zz ;
- break;
- }
- {
- for(int i=anzahl;1<2;1<2)
- {
- cout << " :( Game Over! :( ";
- break;
- }
- }
- }
- }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement