最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

[原創(chuàng)]教你用C/C++制作BrainF**k的編譯器

2022-02-03 15:57 作者:夏夜wandpace  | 我要投稿

#include <cstdio>

#include <cmath>

#include <cstring>

#include <ctime>

#include <iostream>

#include <algorithm>

#include <set>

#include <vector>

#include <sstream>

#include <queue>

#include <typeinfo>

#include <fstream>

#include <map>

#include <windows.h>

#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)

#define maxn 100001

#define eps 1e-9

typedef long long ll;

using namespace std;

const int inf=0x7fffffff;

string s;

vector<char> a;

int kiss;

int i;

void dealk()

{

? ? void deal(char c);

? ? int start=i;

? ? while(1)

? ? {

? ? ? ? i++;

? ? ? ? if(s[i]==']')

? ? ? ? {

? ? ? ? ? ? if(a[kiss]==0)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? break;

? ? ? ? ? ? }

? ? ? ? ? ? else

? ? ? ? ? ? {

? ? ? ? ? ? ? ? i=start;

? ? ? ? ? ? ? ? continue;

? ? ? ? ? ? }

? ? ? ? }

? ? ? ? deal(s[i]);

? ? }

}

void deal(char c)

{

? ? if(c=='+')

? ? ? ? a[kiss]++;

? ? if(c=='-')

? ? ? ? a[kiss]--;

? ? if(c=='>')

? ? {

? ? ? ? kiss++;

? ? ? ? if(kiss>=a.size())

? ? ? ? ? ? a.push_back(0);

? ? }

? ? if(c=='<')

? ? {

? ? ? ? kiss--;

? ? ? ? if(kiss<0)

? ? ? ? {

? ? ? ? ? ? a.insert(a.begin(),i);

? ? ? ? ? ? kiss=0;

? ? ? ? }

? ? }

? ? if(c=='.')

? ? {

? ? ? ? int m=a[kiss];

? ? ? ? printf("%c",m);

? ? }


? ? if(c==',')

? ? {

? ? ? ? char k;

? ? ? ? scanf("%c",&k);

? ? ? ? s[kiss]=k;

? ? }

? ? if(c=='[')

? ? {

? ? ? ? dealk();

? ? }

}


int main()

{

? ? SetConsoleTitle("Brain_NTF v3.1.2");?

? ? cout<<"Brain_NTF version:3.1.2\n";

? ? cout<<"? ? ? ? ? ? ? ? ? ? ? ? ? ? \n";

? ? cout<<"------------information------------\n";

? ? cout<<"Product version:22013022A\n";

? ? system("echo %random% OEM %random%%random%");

? ? system("color 0A");

? ? cout<<"-------------code area--------------\n";

while(cin>>s)

? ? {

? ? ? ? a.push_back(0);

? ? ? ? int kiss=0;

? ? ? ? for(i=0;i<s.size();i++)

? ? ? ? {

? ? ? ? ? ? deal(s[i]);

? ? ? ? }

? ? }

? ? return 0;

}


[原創(chuàng)]教你用C/C++制作BrainF**k的編譯器的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
长春市| 盈江县| 百色市| 三明市| 罗田县| 弋阳县| 穆棱市| 遵义县| 雷州市| 泰兴市| 二手房| 会泽县| 河南省| 南木林县| 巩留县| 康乐县| 邵阳县| 阿巴嘎旗| 思茅市| 黎川县| 木里| 丹江口市| 乌审旗| 祥云县| 灵台县| 闽侯县| 教育| 连江县| 漳平市| 佛冈县| 河间市| 象州县| 峨山| 宁波市| 北流市| 甘德县| 七台河市| 秦安县| 石家庄市| 吉安市| 竹溪县|