In addition to the usual CIN/Cout, the following standard libraries will most likely be required;

Input stream string read

#include <string>
std::getline(cin, std::string, delim)
Copy the code

String to number

#include <string>
int std::stoi(std::string)
Copy the code

Reads data from a string

#include <cstdio>
int std::sscanf(const char *buffer, const char *format, ...)
Copy the code

The value is converted to a string

#include <string>
std::string to_string(value)
Copy the code

The output precision

#include <iomanip> # keep two decimal places after the decimal point, rounded STD ::cout << fixed << STD :: setPrecision (2) << output << STD ::endl;Copy the code