Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

真是绝了,同一份代码g++就能过c++死活wa

Posted by 3145249016 at 2022-04-01 21:03:26 on Problem 3295
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator