Question
I can't seem to get this code to work: #include #include #include #include using namespace std; /** * Auto-generated code below aims at helping you
I can't seem to get this code to work:
#include
#include
#include
#include
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
int main()
{
int N; // Number of elements which make up the association table.
cin >> N; cin.ignore();
int Q; // Number Q of file names to be analyzed.
cin >> Q; cin.ignore();
for (int i = 0; i < N; i++) {
string EXT; // file extension
string MT; // MIME type.
cin >> EXT >> MT; cin.ignore();
}
for (int i = 0; i < Q; i++) {
string FNAME;
getline(cin, FNAME); // One file name per line.
}
// Write an answer using cout. DON'T FORGET THE "<< endl"
// To debug: cerr << "Debug messages..." << endl;
cerr << "Debug messages..." << endl;
cout << "image/gif" << endl;
// For each of the Q filenames, display on a line the corresponding MIME type. If there is no corresponding type, then display UNKNOWN.
cout << "UNKNOWN" << end;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started