diff --git a/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/README.md b/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/README.md new file mode 100644 index 0000000..cc842a7 --- /dev/null +++ b/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/README.md @@ -0,0 +1,11 @@ +# Here is the problem [UVA-1124](https://vjudge.net/problem/UVA-1124) # + +The problem is straightforward: we need to read the input and print it exactly as it is. There are no modifications, no calculations, and no transformations needed. + +At first, the problem might seem tricky, making you think some processing is required, but in reality, it is just a simple input-output task. + +# To solve this problem efficiently # + +* Use getline(cin, line) to read the entire input line, ensuring spaces are preserved. + +* Directly print the input using cout, followed by a newline (\n) to maintain formatting. diff --git a/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/main b/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/main new file mode 100644 index 0000000..b361524 Binary files /dev/null and b/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/main differ diff --git a/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/main.cpp b/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/main.cpp new file mode 100644 index 0000000..5f04294 --- /dev/null +++ b/CompetitiveProgramming3-Book/ch01/2. UVa 01124 - Celebrity Jeopardy/main.cpp @@ -0,0 +1,11 @@ +#include +#include +using namespace std; +int main() { + string x; + + while (getline(cin, x)) { + cout << x << "\n"; + } + return 0; +}