Simple Truthy Check

Simple Truthy Check

Easy PHP PHP Data Types 24 views
Explanation Complexity

Problem Statement

Input is one token. Treat '', '0', and 'false' (case-insensitive) as false, everything else as true. Print TRUE or FALSE.

Input Format

One token s.

Output Format

TRUE or FALSE.

Example

false
FALSE

Constraints

|s|

Input / Output Format

Input Format
One token s.
Output Format
TRUE or FALSE.
Constraints
|s|

Examples

Input:
false
Output:
FALSE

Example Solution (Public)

PHP
<?php
$inputText=trim(stream_get_contents(STDIN));
if($inputText==='') { echo 'FALSE'; exit; }
$low=strtolower($inputText);
if($low==='0' || $low==='false') echo 'FALSE'; else echo 'TRUE';
?>

Official Solution Code

<?php
$inputText=trim(stream_get_contents(STDIN));
if($inputText==='') { echo 'FALSE'; exit; }
$low=strtolower($inputText);
if($low==='0' || $low==='false') echo 'FALSE'; else echo 'TRUE';
?>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.