main.cpp
来自「ssd5的答案 op2 希望大家用处!」· C++ 代码 · 共 33 行
CPP
33 行
#include <iostream>
#include <cstdlib>
#include <stdexcept>
#include <string>
#include "simulator.h"
#include "fifo.h"
using namespace std;
int main (int argc, char *argv[]) {
if (argc != 2) {
cerr << "Usage: " << argv[0] << " data-file\n";
return EXIT_FAILURE;
}
try {
string file = argv[1];
simulator *s = new fifo (2);
s->simulate(file);
delete s;
}
catch(exception& e) {
cerr << e.what() << endl;
}
catch(...) {
cerr << "Unknown exception caught!" << endl;
}
return EXIT_FAILURE;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?