这是所谓的二叉树么.. 算法很简单, 只是因为第一次用这种结构体封装, 还是试了很多次才摸索出来的.. 很好用诶! 记一下
细节.. 地址和变量不要搞混了.. 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:
Kingmaker casino echtgeld spielen einzahlung https://33.pexeburay.com
References:
Kingmaker casino anmelden einzahlung maps.google.so
References:
Legiano Casino Cashback http://www.swadba.by/
References:
Kingmaker Casino Seriös http://cse.google.cg/
References:
Legiano Casino Mindestauszahlung board-es.seafight.com
References:
Legiano Casino Anmeldung solaris-forum.ru
References:
Monro Casino Gewinne http://world.school2100.com/bitrix/redirect.php?goto=https://l2l.li/edgarv0159057
References:
Hit’n’spin casino no deposit bonus http://maps.google.bi
References:
Hit n spin casino erfahrungen https://allbut.co.kr/member/login.html?noMemberOrder=&returnUrl=http://wikimapia.org/external_link?url=https://de.trustpilot.com/review/der-wikinger-shop.de
References:
Monro Casino Auszahlung Probleme http://www.google.com.hk/url?q=https://smartbusinesscards.in/leonorefizelle
References:
Hitnspin free spins http://www.google.gp/
References:
Hitnspin casino aktionscode https://www.camangels.com
References:
Hit’n’spin casino 25 euro code slidesgo.com
References:
Hitnspin casino paysafecard http://cse.google.cv/
References:
Hitnspin willkommensbonus http://www.btccfo.com/wp-content/themes/begin/inc/go.php?url=https://www.comita.ru/bitrix/click.php?goto=https://de.trustpilot.com/review/der-wikinger-shop.de
References:
Hitnspin casino alternative avensis-forum.de
References:
Hitnspin casino paysafecard m.focusis.co.kr
References:
Hitnspin casino registrierung it.rojadirecta.eu
References:
Hitnspin casino demo https://freerepublic.com/~voyagesechellesluxe/index?U=https://mensvault.men/story.php?title=hitnspin-deutschland-bonus-800-200-freespins
References:
Hit n spin casino online login plitkat.ru
References:
Hitnspin casino ähnliche casinos arduino-tex.ru
References:
Lollybet Casino PayPal http://may2009.archive.ensembl.org/Help/Permalink?url=http://maps.google.ms/url?q=https://lollybet.com.de/
References:
Monro Casino Einzahlung https://forum-msk.info/
References:
Lollybet Casino https://go.115.com/
References:
Lollybet Casino PayPal https://trac.filezilla-project.org/search?q=http://maps.google.com.pg/url?q=https://blackcoin.co/list-of-casinos-in-brisbane/
References:
Lollybet Casino Live Dealer http://www.google.co.bw/url?sa=t&url=https://cse.google.com.nf/url?q=https://lollybet.com.de//
References:
Lollybet Free Spins maps.google.com.ec
References:
Lollybet Casino Bonusbedingungen images.google.com.tw
References:
Lollybet Casino Promo Code id41.ru
References:
Lollybet Umsatzbedingungen https://blackmod.net/dl/?url=aHR0cDovL2thcmF5YXoucnUvdXNlci9wYWlyd2FzaDAv
References:
Lollybet Casino Bonus http://cse.google.tn/
References:
Lollybet Casino Auszahlungsdauer http://toolbarqueries.google.de/url?sa=t&url=https://architecturewiki.site/wiki/1_000_Bonus_Slots_schnelle_Auszahlung
References:
Lollybet Casino Registrierung domfialki.ru
References:
Lollybet Bonus Code http://forum-otzyvov.ru/proxy.php?link=https://livebookmark.stream/story.php?title=instant-casino-offizielles-online-casino-fuer-echtgeldspiele
References:
Hit n spin casino app http://cse.google.ac
References:
Hitnspin casino mit echtgeld http://clients1.google.me/
References:
Hitnspin casino einzahlung http://clients1.google.iq
References:
Hitnspin casino trustpilot cse.google.com.au
References:
Hit n spin casino online login http://alt1.toolbarqueries.google.vg
References:
Hitnspin casino http://app.feedblitz.com/f/f.fbz?track=https://pikidi.com/seller/profile/nurseshare11/
References:
Hitnspin casino anmeldung clients1.google.tl
References:
Hitnspin casino forum http://clients1.google.dk/
References:
Hitnspin casino bewertung http://image.google.am/url?sa=t&source=web&rct=j&url=https://www.orkhonschool.edu.mn/profile/krarupamtnygaard71504/profile
References:
Hitnspin casino aktionscode http://it.thefreedictionary.com/
References:
Online pokies australia payid real money https://video.gictafrica.com/
References:
Best instant payid pokies australia real money carrefourtalents.com
References:
Online pokies with payid https://klimaexpress-tube.de/
References:
Pokies net australia payid withdrawal https://nonstopvn.net/@federicow35926?page=about
References:
Payid pokies instant withdrawal https://gratisafhalen.be/
References:
Australian online pokies payid trabalho.funerariamantovani.com.br