资源简介
C 编写
代码片段和文件信息
#include “testlib.h“
#include
#define forn(i n) for (int i = 0; i < int(n); i++)
using namespace std;
void fail(const string& message) {
cerr << “ERROR: “ << message << endl;
exit(1);
}
string interpretCode(const string& commands)
{
vector data(1 0);
vector::iterator dataPtr = data.begin();
string::const_iterator instructionPtr = commands.begin();
stack instructionStack;
int iterationCount = 0;
string result;
while (instructionPtr != commands.end())
{
iterationCount++;
if (iterationCount > 50000000)
fail(“Too many instructions“);
switch (*instructionPtr)
{
case ‘<‘:
{
- 上一篇:超声波测距 (c语言)
- 下一篇:c++ 旋转的图像(遮罩贴图)
评论
共有 条评论