| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
真是绝了,同一份代码g++就能过c++死活wa#include<iostream>
#include<cstdio>
#include<string.h>
using namespace std;
char a[100000];
int bb[10],aa,length,fl,index=0;
bool check()
{
char c=a[index];
bool w,x;
index++;
switch(c)
{
case 'p': return bb[0];
case 'q': return bb[1];
case 'r': return bb[2];
case 's': return bb[3];
case 't': return bb[4];
case 'N': return !check();
case 'K': w=check();x=check();return (w&&x);
case 'A': w=check();x=check();return (w||x);
case 'C': w=check();x=check();return (w<=x);
case 'E': w=check();x=check();return (w==x);
default:return 0;
}
}
int main()
{
while(1)
{
cin>>a;
if(a[0]=='0')
break;
fl=0;
for(int i=0;i<=31;i++)
{
aa=i;
for(int j=0;j<5;j++)
{
bb[j]=aa%2;
aa/=2;
}
index=0;
if(!check())
{
fl=1;
break;
}
}
if(fl==1)
cout<<"not"<<endl;
else
cout<<"tautology"<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator