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 |

Language: Tautology
Description WFF 'N PROOF is a logic game played with dice. Each die has six faces representing some subset of the possible symbols K, A, N, C, E, p, q, r, s, t. A Well-formed formula (WFF) is any string of these symbols obeying the following rules: - p, q, r, s, and t are WFFs
- if
*w*is a WFF, N*w*is a WFF - if
*w*and*x*are WFFs, K*wx*, A*wx*, C*wx*, and E*wx*are WFFs.
- p, q, r, s, and t are logical variables that may take on the value 0 (false) or 1 (true).
- K, A, N, C, E mean
*and, or, not, implies,*and*equals*as defined in the truth table below.
A You must determine whether or not a WFF is a tautology. Input Input consists of several test cases. Each test case is a single line containing a WFF with no more than 100 symbols. A line containing 0 follows the last case. Output For each test case, output a line containing Sample Input ApNp ApNq 0 Sample Output tautology not Source Waterloo Local Contest, 2006.9.30 |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator