早教吧 育儿知识 作业答案 考试题库 百科 知识分享

C++单词调换#include#include#include#include#include#include#includeusingnamespacestd;ifstream&openfile(ifstream&in,conststring&file);intmain(intargc,char**argv){maptransmap;stringkey,value;if(argc=3)throwruntimeerror

题目详情
C++ 单词调换
#include
#include
#include
#include
#include
#include
#include
using namespace std;
ifstream& open_file(ifstream &in,const string &file);
int main (int argc,char **argv)
{
map trans_map;
string key,value;
if (argc = 3)
throw runtime_error("wrong number of arguments");
ifstream map_file;
if open_file(map_file,"test_in.txt"))
{
cout key >> value)
trans_map.insert(make_pair(key,value));
ifstream input;
if open_file(input,"test_out.txt"))
{
cout word)
{
map::const_iterator map_it = trans_map.find(word);
if (map_it = trans_map.end())
word = map_it->second;
if (firstword)
firstword = false;
else
cout
▼优质解答
答案和解析
Project(工程)=》 Setting(设置)
Debug部分 第三行,写
test_in.txt test_out.txt
外面实验就造一个快捷方式
C:\1\2\test.exe test_in.txt test_out.txt