<?php

function readInput()
{
    return array_map(
        'floatval',
        explode(" ",trim(fgets(STDIN)))
    );
}

function tipoQuadrante($x,$y)
{   
    if($x > 0 && $y > 0){return"primeiro";}
    if($x < 0 && $y > 0){return"segundo";}
    if($x < 0 && $y < 0){return"terceiro";}
    if($x > 0 && $y < 0){return"quarto";}    
}

do {
    $boll =true;
    
    [$x,$y] =readInput();

    if ($x == 0 || $y == 0) {
        $boll=false;
    }else{
        echo tipoQuadrante($x,$y) . PHP_EOL;
    }
        
} while ($boll);

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: