<?php
$indiceMaximoArray = (int) trim(fgets(STDIN));
$arrayMoedas = [];
$umCentavo = 0;
$cincoCentavos = 0;
$dezCentavos = 0;
$vinteECincoCentavos = 0;
$cinquentaCentavos = 0;
$umReal = 0;

for ($i=0 ; $i<$indiceMaximoArray ; $i++) {
    $arrayMoedas[$i] = (int) trim(fgets(STDIN));
    if ($arrayMoedas[$i] == 1) {
        $umCentavo++;
    } elseif ($arrayMoedas[$i] == 5) {
        $cincoCentavos++;
    } elseif ($arrayMoedas [$i] == 10) {
        $dezCentavos++;
    } elseif ($arrayMoedas [$i] == 25) {
        $vinteECincoCentavos++;
    } elseif ($arrayMoedas[$i] == 50) {
        $cinquentaCentavos++;
    } else {
        $umReal++;
    }
}
echo "Moedas de 1 centavo: $umCentavo\n";
echo "Moedas de 5 centavos: $cincoCentavos\n";
echo "Moedas de 10 centavos: $dezCentavos\n";
echo "Moedas de 25 centavos: $vinteECincoCentavos\n";
echo "Moedas de 50 centavos: $cinquentaCentavos\n";
echo "Moedas de 1 real: $umReal\n";
?>

Embed on website

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