Updated to new Semester

This commit is contained in:
2025-02-20 13:54:56 +01:00
parent 35a05a634e
commit 2b700071aa
18 changed files with 36 additions and 51 deletions

View File

@@ -1,22 +0,0 @@
#include <iostream>
#include "guess_a_number.h"
int main() {
// Declare the required variables
int number_to_guess; // The number to guess
int guess; // The guessed number
// Pick the number to guess
std::cout << "Number to guess: ";
number_to_guess = choose_a_number(3); // Randomly choose a number from the interval [1, 3]
// Save number inputted by user into variable guess
std::cin >> guess;
std::cout << "Your guess: ";
if (guess == number_to_guess) {
std::cout << "Congratulations, you correctly guessed " << number_to_guess << "!";
} else {
std::cout << "Sorry, but " << guess << " is wrong, " << number_to_guess << " was the number to guess.";
}
}