Created the guesser.cpp
This commit is contained in:
parent
f95d13537e
commit
4c33528156
21
guesser.cpp
Normal file
21
guesser.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
srand(time(NULL));
|
||||
int random = 1 + (rand() % 9);
|
||||
|
||||
cout << "An welche Zahl denke ich? ";
|
||||
|
||||
int number;
|
||||
cin >> number;
|
||||
|
||||
if (number == random) {
|
||||
cout << "Congrats, die Zahl war richtig. :)";
|
||||
} else {
|
||||
cout << "Leider falsch. Die richtige Zahl war " << random;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user