无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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)遵守國家法律
西畴县| 永泰县| 汪清县| 比如县| 屏边| 安国市| 唐山市| 内丘县| 苗栗市| 和政县| 淳化县| 凌云县| 明溪县| 清水河县| 河东区| 蓬溪县| 原阳县| 乌兰浩特市| 沧源| 镇雄县| 新安县| 兴城市| 镇巴县| 襄城县| 垣曲县| 凤翔县| 嘉祥县| 大港区| 永川市| 巴彦淖尔市| 抚松县| 古蔺县| 固安县| 祁东县| 宽城| 寻乌县| 德保县| 平乐县| 城步| 嵊州市| 冷水江市|