#include #include //for getenv, EXIT_SUCCESS, EXIT_FAILURE #include "cgi.h" //for class cgi using namespace std; string display_color(const string& s); int main() { cout << "Content-type: text/html\n\n"; //CGI MIME-type header cout << "\n" "\n" "\n" "Gateway\n" "\n" "\n" "\n" "

Gateway

\n"; cgi c; const map& m {c.get_input()}; cout << "
    \n"; //ordered list for (const auto& pair: m) { cout << "
  1. " << pair.first << "=" << pair.second << display_color(pair.second) << "
  2. \n"; } cout << "
\n"; cout << "\n" "\n"; return EXIT_SUCCESS; } //If s is of the form %23rrggbb, return an HTML SPAN element to display a sample //of that color. The %23 is the ASCII code of the character '#'. string display_color(const string& s) { string html; if (s.substr(0, 3) == "%23" && s.size() == 3 + 6) { html = "          "; } return html; }