这是所谓的二叉树么.. 算法很简单, 只是因为第一次用这种结构体封装, 还是试了很多次才摸索出来的.. 很好用诶! 记一下
细节.. 地址和变量不要搞混了.. 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:
Casino Dealer werden online casino aachen
References:
Best online slots https://mvacancy.com/companies/best-payid-casinos-australia-2026-for-quick-withdrawals
References:
Legiano Casino Kontakt toolbarqueries.google.gp
References:
Legiano Casino Zahlungsmethoden es.thefreedictionary.com
References:
Legiano Casino Slots https://forum.mds.ru/proxy.php?link=https://qr.dsd.edu.gh/noemichapa460
References:
Legiano Casino Erfahrungen https://community.playstarbound.com/
References:
Legiano Casino Alternative http://burana.ijs.si/
References:
Legiano Casino App postjung.com
References:
Legiano Casino Sicherheit http://images.google.tk
References:
Legiano Casino App https://go.115.com/?http://www.visit-x.net/promo/dyn/dynchat02.php?pfmbanner=1&ver=12&clickurl=https://de.trustpilot.com/review/beyondjewellery.de
References:
Legiano Casino Deutschland freesexcamca.chaturbate.com
References:
Legiano Casino Lizenz inlinehokej.sh10w2.esports.cz
References:
Legiano Casino Anmeldung polosedan-club.com
References:
Legiano Casino Spielen https://pwonline.ru
References:
Legiano Casino sicher google.com.uy
References:
Legiano Casino Neukundenbonus images.google.cl
References:
Legiano Casino Willkommensbonus https://freesexcams69.chaturbate.com/external_link/?url=https://de.trustpilot.com/review/edelkranz.de
References:
Leggiano Casino http://cies.xrea.jp/jump/?https://tinhte.vn/proxy.php?link=https://de.trustpilot.com/review/beyondjewellery.de
References:
Legiano Casino Zahlungsmethoden http://www.google.mn/url?q=https://depts.washington.edu/fulab/fulab-wiki/api.php?action=https://de.trustpilot.com/review/beyondjewellery.de
References:
Legiano Casino Live Casino perevodvsem.ru
References:
Legiano Casino No Deposit Bonus 95.cholteth.com
References:
Legiano Casino Anmeldung http://kartinki.net/a/redir/?url=http://forum.reizastudios.com/proxy.php?link=https://de.trustpilot.com/review/der-wikinger-shop.dehttp://kartinki.net/a/redir/?url=http://forum.reizastudios.com/proxy.php?link=https://de.trustpilot.com/review/der-wikinger-shop.de</a
References:
Legiano Casino Bewertung http://burgman-club.ru/
References:
KingMaker Casino Einzahlung per Giropay qr-th.com
References:
KingMaker geld einzahlen mydaradstools.com
References:
KingMaker Casino 50 Freispiele nach Einzahlung https://nfccardmaker.com
References:
KingMaker Casino Auszahlungsdauer https://m.2target.net/amadorenne
References:
Kingmaker casino einzahlung deutschland http://www.google.com.pa
References:
Kingmaker casino bonus code einzahlung http://www.google.ms/url?sa=t&url=https://de.trustpilot.com/review/beyondjewellery.de/
References:
Kingmaker casino bankeinzahlung https://kalendar.vse.cz/event/show?date=4145&backlinkUrl=https://de.trustpilot.com/review/beyondjewellery.de
References:
KingMaker Casino Echtgeld spielen http://xtblogging.yn.lt/
References:
Kingmaker casino visa einzahlung danieldefo.ru
References:
KingMaker krypto einzahlung http://toolbarqueries.google.com.ng/
References:
KingMaker Casino Reload Bonus https://tulum.ru/catalog/view/theme/quick-view.php?product_id=2702&product_href=http://mylinkbox.me/coral66k38
References:
Legiano Casino Freispiele http://wartank.ru
References:
KingMaker einzahlung banküberweisung http://maps.google.com.ai/
References:
Kingmaker Casino Live Casino cse.google.com.om
References:
Legiano Casino Code maps.google.sh
References:
KingMaker einzahlung sofort spielen forums.dovetailgames.com
References:
Legiano Casino Gutscheincode cse.google.com.sb
References:
KingMaker Casino Einzahlung per Giropay http://maps.google.com.ar/url?q=https://link.1hut.ru/jakejerome7950
References:
Legiano Casino PayPal cerldev.kek.jp
References:
KingMaker Casino Einzahlung per Kryptowährung cse.google.ru
References:
KingMaker einzahlung verdoppeln https://disput-pmr.ru/proxy.php?link=https://link.mym.ge/dedraweeks0743
References:
KingMaker Casino Mindesteinzahlung 5 Euro http://www.google.de/url?q=https://watchnow.site/jenscharbonnea
References:
Legiano Casino VIP Programm https://omnimed.ru/bitrix/redirect.php?event1=&event2=&event3=&goto=https://materialwiki.site/wiki/Leguano_Aktiv_Plus_in_MecklenburgVorpommern
References:
Legiano Casino Codes http://clients1.google.tl/url?q=https://architecturewiki.site/wiki/Spiele_Wetten_exklusive_Aktionen_online
References:
Legiano Casino Bewertung http://images.google.pn
References:
Legiano Casino Codes http://toolbarqueries.google.ws/
References:
Kingmaker casino kryptowährung einzahlen http://www.proplay.ru/