这是所谓的二叉树么.. 算法很简单, 只是因为第一次用这种结构体封装, 还是试了很多次才摸索出来的.. 很好用诶! 记一下
细节.. 地址和变量不要搞混了.. fw?fw->v():false 我写成了fw->v()? 错了好久
[cpp]#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct Orz {
Orz *fw,*fx;
bool (*f)(bool w,bool x);
bool v() {
return (*f)(fw?fw->v():false,fx?fx->v():false);
};
bool p[5];
char sb[]={‘K’,’A’,’C’,’E’,’N’,’p’,’q’,’r’,’s’,’t’};
char input[201];
int count;
bool fK(bool w,bool x) { return w&x; }
bool fA(bool w,bool x) { return w|x; }
bool fC(bool w,bool x) { return !(w&&!x); }
bool fE(bool w,bool x) { return !(w^x); }
bool fN(bool w,bool x) { return !w; }
bool fp(bool w,bool x) { return p[0]; }
bool fq(bool w,bool x) { return p[1]; }
bool fr(bool w,bool x) { return p[2]; }
bool fs(bool w,bool x) { return p[3]; }
bool ft(bool w,bool x) { return p[4]; }
bool (*f[])(bool w,bool x)={fK,fA,fC,fE,fN,fp,fq,fr,fs,ft};
Orz *proc() {
char a=input[count++];
Orz *node=(Orz *)malloc(sizeof(Orz));
node->fw=node->fx=NULL;
int type;
for(type=0;sb[type]!=a;type++);
node->f=f[type];
if(type<=4)
node->fw=proc();
if(type<4)
node->fx=proc();
return node;
}
int pow2(int n) {
int r=1;
for(int i=0;i<n;i++)
r*=2;
return r;
}
int main() {
while(1) {
gets(input);
if(input[0]==’0′)
break;
count=0;
Orz *bigBang=proc();
short tester;
for(tester=0x0000;tester<=0x001f;tester++) {
for(int i=0;i<5;i++)
p[i]=tester/pow2(i)%2;
if(bigBang->v()!=true)
break;
}
if(tester==0x0020)
printf("tautology\n");
else
printf("not\n");
}
return 0;
}
[/cpp]
References:
Lollybet Spiele images.google.st
References:
Lollybet Auszahlung http://maps.google.sc/url?sa=t&url=https://www.mydaradstools.com/verazambra
References:
Lollybet Casino Bonus ohne Einzahlung http://image.google.co.ma/
References:
Lollybet Casino Live Dealer 21.cholteth.com
References:
Lollybet Meinung https://ar.paltalk.com
References:
Lollybet Casino http://images.google.cg/
References:
Lollybet Casino Bonus ohne Umsatzbedingungen http://cse.google.co.cr/
References:
Lollybet Auszahlung https://tz.goodinternet.org
References:
Lollybet Casino VIP https://ntsr.info
References:
No deposit sign up bonus worldaid.eu.org
References:
Luxury casino mobile https://healthjobslounge.com
References:
Wild rose casino clinton iowa asanghaa.com
References:
Baton rouge casino https://eoglaszamy.pl/
References:
Slots no deposit bonus pageofjobs.com
References:
Sahara casino truckers.wiki
References:
Aria casino las vegas https://jobcopae.com/employer/top-casinos-ohne-verifizierung-2026-anonym-und-ohne-kyc/
References:
Uk online casinos spechrom.com
References:
Lollybet Casino Blackjack http://www.google.co.in/url?q=https://investsolutions.org.uk/employer/lollybet-boni-30-freispiele-225-willkommensangebot/
References:
Lollybet Casino Einzahlung https://64.cholteth.com/index/d1?diff=0&utm_source=ogdd&utm_campaign=26607&utm_content=&utm_clickid=g00w000go8sgcg0k&aurl=https://inoad.kr/online/2026-07-27-043146-%EB%AC%B8%EC%9D%98/
References:
Lollybet Casino Paysafecard http://images.google.com.ni/url?q=https://africa.careers/employer/lolly-bet/
References:
Lollybet Casino Einzahlung http://image.google.me/url?q=https://raovatonline.org/author/joesphallar/
References:
Lollybet Casino Spielautomaten http://www.google.com.sa/url?q=https://jobpk.pk/companies/top-boni-ohne-einzahlungen-2026-casino-bonus-codes-sichern/
References:
Lollybet Deutschland Login https://volos-volos.ru/proxy.php?link=https://salestracker.realitytraining.com/node/48854