I

@ItaloLopesAndrade

Videoaula 18 - Exercício 1 - Solução 3 professor

PHP
1 year ago
<?php $vetor = []; $indice = 0; $ind_menor_ele = 0; // Leitura dos 10 valores reais for ($indice = 0; $indice < 10; $indice++) { fscanf(STDIN, "%f\n", $vetor[$indice]); }

Videoaula 18 - Exercício 1 - Solução 2 professor

PHP
1 year ago
<?php $vetor = []; $menor = 0.0; $indice = 0; $ind_menor_ele = 0; // Leitura dos 10 valores reais for ($indice = 0; $indice < 10; $indice++) { fscanf(STDIN, "%f\n", $vetor[$indice]); }

Videoaula 18 - Exercício 1 - Solução 1 professor

PHP
1 year ago
<?php $vetor = []; $menor = 0.0; $indice = 0; $ind_menor_ele = 0; // Lê os 10 valores for ($indice = 0; $indice < 10; $indice++) { fscanf(STDIN, "%f\n", $vetor[$indice]); }

Videoaula 18 - Exercício 1 - Minha solução sem //

PHP
1 year ago
<?php $armazenadorComparacao = 0.0; $indiceDoMenor = 0; $array = []; for ($i=0 ; $i < 10 ; $i++) { $entrada = trim(fgets(STDIN)); $array [$i] = $entrada; if ($entrada < $armazenadorComparacao) { $armazenadorComparaca

Videoaula 18 - Exercício 1 - Arrays - Minha Solução

PHP
1 year ago
<?php $armazenadorComparacao = 0.0; $indiceDoMenor = 0; $array = []; //echo "Armazenador antes1: $armazenadorComparacao\n"; for ($i=0 ; $i < 10 ; $i++) { $entrada = trim(fgets(STDIN)); $array [$i] = $entrada; //echo "

Videoaula 18 - Exercício 2 - Arrays

PHP
1 year ago
<?php ?>

Videoaula 17 - Exercício 1 - "foreach( );" resolução 2 professor

PHP
1 year ago
<?php $valores=[]; $quantidade = 10; echo "Digite $quantidade números reais:\n"; for ($i = 0; $i < $quantidade; $i++) { while (true) { echo "Valor [" . ($i + 1) . "]: \n"; $entrada = trim(fgets(STDIN)); if (is_numeric($e

Videoaula 17 - Exercício 1 - Resolução do Professor

PHP
1 year ago
<?php // Inicializa um vetor vazio para armazenar os 10 números reais $valores=[]; $quantidade = 10; echo "Digite $quantidade números reais:\n"; // Laço para coletar os 10 números do usuário for ($i = 0; $i < $quantidade; $i++) { while (true) {

Videoaula 17 - IS SET - if(isset($meuArray))

PHP
1 year ago
<?php $valores=[]; $valores[0]=1; //Vamos supor que aqui teríamos várias linhas no script... if(isset($valores[5])){ echo $valores[5]."\n"; } ?>

Videoaula 17 - Acessar individualmente os elementos de um vetor (utilizando índices).

PHP
1 year ago
<?php //as posições do vetor começam na 0 //criação de um vetor (array) com nome valores $valores = []; //colocando o valor 1 na posição 0 do vetor $valores $valores[0]=1;

Videoaula 17 - Exercício 1 - Minha resolução

PHP
1 year ago
<?php $vetor = []; for ($i=0 ; $i < 10 ; $i++) { fscanf(STDIN, "%f", $entrada); $vetor[$i] = $entrada; echo "Vetor de índice {$i} é: {$vetor[$i]}\n"; } ?>

beecrowd 1170

PHP
1 year ago
<?php fscanf(STDIN, "%d", $NumberOfTestCases); for ($i=0; $i<$NumberOfTestCases; $i++) { fscanf(STDIN, "%f", $FoodInKg); for ($i2=0; $FoodInKg > 1; $i2++){ $FoodInKg /= 2; }

beecrowd 1170 !comentários EN

PHP
1 year ago
<?php // 1- receive the number of test cases (times the first 'for' loop reads Food in Kg) fscanf(STDIN, "%d", $NumberOfTestCases); // 2- the for below will loop X times (X = $NumberOfTestCases) and reads a different $FoodInKg value each time for

beecrowd 1170 !rascunho

PHP
1 year ago
<?php // 1- receive the number of test cases (times the first 'for' loop reads Food in Kg) fscanf(STDIN, "%d", $NumberOfTestCases); // 2- the for below will loop X times (X = $NumberOfTestCases) and reads a different $FoodInKg value each time for

beecrowd 1093

PHP
1 year ago
<?php // $AT = constante; // $D = constante; // $AT é o mesmo para os dois, se o dado rolar n° <= $AT V1 ganha // se $D > $AT V2 ganha // vencedor suga valor $D do $EV inimigo // combate acaba quando um dos dois tiver $EV <= 0 // o resultado do dad

beecrowd 1047

PHP
1 year ago
<?php // dia vai até 12pm ou 24:00? fscanf(STDIN, "%d%d%d%d", $HoraInicial, $MinutoInicial, $HoraFinal, $MinutoFinal); ?>

beecrowd 2006

PHP
1 year ago
<?php fscanf(STDIN, "%d", $TeaType); fscanf(STDIN, "%d%d%d%d%d", $A,$B,$C,$D,$E); $correct = 0; for($i = 0;$i <5;$i++) { if ($TeaType == $A){ $correct++; } if ($TeaType == $B){

beecrowd 1028

PHP
1 year ago
<?php // F1 > F2 // F1 = F2 // F1 < F2 fscanf(STDIN, "%d", $N); for ($i = 0;$i < $N;$i++) { fscanf(STDIN, "%d %d", $F1, $F2); if ($F2 == $F1) { $mdc = $F1;

beecrowd 1037

PHP
1 year ago
<?php fscanf (STDIN, "%f", $number); $number += 0.00000000000000; if ($number >= 0 && $number <= 25) { echo "Intervalo [0,25]\n"; } elseif ($number > 25 && $number <= 50) { echo "Intervalo (25,50]\n"; } elseif ($number > 50 && $number <= 75)

beecrowd 1036

PHP
1 year ago
<?php fscanf(STDIN, "%f %f %f", $A, $B, $C); $delta = ($B**2) - (4*$A*$C); if ($A != 0 && $delta >= 0) { $R1 = (-($B) + sqrt($delta)) / (2*$A); $R2 = (-($B) - sqrt($delta)) / (2*$A); printf ("R1 = %.5f\nR2 = %.5f\n", $R1, $R2); } else {