how to read the output in c++

how to read the output in c++

I am solving a codechef problem. I have to ask Q queries (which I would have to print) and for every query computer would give me an output which I would have to save to use for another query. The problem statement states:

I am solving a codechef problem. I have to ask Q queries (which I would have to print) and for every query computer would give me an output which I would have to save to use for another query. The problem statement states:

For each test case, you may ask queries. To ask a query, print a line >containing the character 'Q', a space and two space-separated integers >x0 and y0 (0≤x0,y0≤109). Then, you should read a line containing a >single integer. If this integer is non-negative, it denotes the answer >to your query. Otherwise, it means that you exceeded the limit on the >number of queries, the coordinates you printed are invalid or some >other error occured. When you have found the secret rectangle, you should print a line >containing the character 'A', a space and four space-separated integers >xl, yl, xu and yu. Then, you should read a single line containing one >integer, which is 1 if your answer was correct or negative if it was wrong.

How do I save output given from one query as input for another?

c++

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Loops in C++ | For, While, and Do While Loops in C++

In this Video We are going to see how to use Loops in C++. We will see How to use For, While, and Do While Loops in C++.

Using isdigit() in C/C++

In this article, we'll take a look at using the isdigit() function in C/C++. This is a very simple way to check if any value is a digit or not. Let's look

C++ Tutorial for Beginners 19 - C++ Structures | Struct declaration | C++ Data Structures

Welcome to this course on C++ Tutorial for Beginners. In this video we will see How to use C++ Structures.

Object Oriented Programming in C++ | C++ OOPs Concepts | Learn Object Oriented C++

C++ is general purpose, compiled, object-oriented programming language and its concepts served as the basis for several other languages such as Java, Python, Ruby, Perl etc.

A Complete Guide to fread() in C/C++

In this article, we’ll take a look at using fread() in C/C++.