国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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)遵守國家法律
洪江市| 鹿泉市| 临洮县| 新河县| 家居| 开江县| 武冈市| 合水县| 大竹县| 唐山市| 景宁| 资中县| 靖江市| 临湘市| 遵义市| 南安市| 鄂温| 保康县| 宁阳县| 揭西县| 元阳县| 金山区| 勐海县| 靖远县| 涡阳县| 新竹市| 威海市| 招远市| 克拉玛依市| 娄烦县| 蕲春县| 仁怀市| 平山县| 喀什市| 通化县| 保靖县| 托克托县| 鄢陵县| 邯郸市| 普兰店市| 西平县|