I

@ItaloLopesAndrade

beecrowd 1035

PHP
1 year ago
<?php fscanf(STDIN, "%d %d %d %d", $A, $B, $C, $D); if ($B > $C && $D > $A && $C + $D > $A + $B && ($C > 0 && $D > 0) && $A % 2 == 0) { echo "Valores aceitos\n"; } else { echo "Valores nao aceitos\n"; } ?>

beecrowd 1021

PHP
1 year ago
<?php fscanf(STDIN, "%f", $value); $value *= (int) 100; $cem = intdiv($value, 10000); $value %= 10000; $cinquenta = intdiv($value ,5000); $value %= 5000; $vinte = intdiv($value ,2000);

beecrowd 1021 (time out/com subtração demora demais)

PHP
1 year ago
<?php fscanf(STDIN, "%f", $value); $cem = 0; $cinquenta = 0; $vinte = 0; $dez = 0; $cinco = 0; $dois = 0;

beecrowd 1020

PHP
1 year ago
<?php fscanf(STDIN, "%d", $AgeInDays); $years = 0; $months = 0; $days = 0; if ($AgeInDays >= 365) { $years = $AgeInDays / 365; $years = (int) $years;

beecrowd 1019

PHP
1 year ago
<?php fscanf(STDIN, "%d", $NN); $N = $NN; $hours = 0; $minutes = 0; $seconds = 0; // -- HOURS -- if ($N >= 3600) {

beecrowd 1018

PHP
1 year ago
<?php fscanf(STDIN, "%d", $NN); $cem = 0; $cinquenta = 0; $vinte = 0; $dez = 0; $cinco = 0; $dois = 0; $um = 0;

beecrowd 1017

PHP
1 year ago
<?php // 12km/L fscanf(STDIN, "%d", $hours); fscanf(STDIN, "%d", $speed); $liters = ($speed * $hours)/12; printf("%.3f\n", $liters); ?>

beecrowd 1015

PHP
1 year ago
<?php fscanf(STDIN, "%f%f", $x1, $y1); fscanf(STDIN, "%f%f", $x2, $y2); $distance = sqrt(($x2-$x1)**2 + ($y2-$y1)**2); printf("%.4f\n", $distance); ?>

JUDE UFBA Letra H

PHP
1 year ago
<?php fscanf(STDIN, "%d", $N); fscanf(STDIN, "%d", $M); // 48 // 36 if ($M > $N) { $temp = $M; $M = $N;

beecrowd 1014

PHP
1 year ago
<?php fscanf(STDIN, "%d", $Km); fscanf(STDIN, "%f", $FuelTotal); $AverageConsumption = $Km/$FuelTotal; printf("%.3f km/l\n", $AverageConsumption); ?>

beecrowd 1013

PHP
1 year ago
<?php fscanf(STDIN, "%d %d %d", $a, $b, $c); $MaiorAB = ($a+$b+abs($a-$b))/2; $MaiorABC = ($c+$MaiorAB+abs($c-$MaiorAB))/2; echo "$MaiorABC eh o maior\n"; ?>

beecrowd 1012

PHP
1 year ago
<?php fscanf(STDIN, "%f %f %f", $a, $b, $c); $AreaRectangledTriangle = ($a*$c)/2; $AreaRadiusCircle = 3.14159*$c**2; $AreaTrapezium = (($a+$b)*$c)/2; $AreaSquare = $b**2; $AreaRectangle = $a*$b; printf("TRIANGULO: %.3f\nCIRCULO: %.3f\nTRAPEZIO: %.3f

beecrowd 1011

PHP
1 year ago
<?php fscanf(STDIN, "%f", $radius); $volume = (4/3) * 3.14159 * $radius**3; printf("VOLUME = %.3f\n", $volume); ?>

beecrowd 1010

PHP
1 year ago
<?php for ($i=0,$accumulatorTotal=0;$i<=1;$i++) { fscanf(STDIN,"%d%d%f\n",$code,$units,$price); $accumulatorTotal += $units * $price; } printf ("VALOR A PAGAR: R$ %.2f\n", $accumulatorTotal); ?>

beecrowd 1009

PHP
1 year ago
<?php fscanf(STDIN, "%s", $n); fscanf(STDIN, "%f", $s); fscanf(STDIN, "%f", $t); $tt=$s+$t*0.15; printf("%s%.2f\n","TOTAL = R$ ",$tt) ?>

beecrowd 1008

PHP
1 year ago
<?php fscanf(STDIN,"%d",$n); fscanf(STDIN,"%d",$h); fscanf(STDIN,"%f",$a); echo"NUMBER = ".$n."\n"."SALARY = U$ ".number_format($h*$a, 2,".","")."\n"; ?>

beecrowd 1007

PHP
1 year ago
<?php fscanf(STDIN,"%d",$a);fscanf(STDIN,"%d",$b);fscanf(STDIN,"%d",$c);fscanf(STDIN,"%d",$d);echo"DIFERENCA = ".($a*$b-$c*$d); ?>

beecrowd 1006 v3

PHP
1 year ago
<?php fscanf(STDIN,"%f",$a);fscanf(STDIN,"%f",$b);fscanf(STDIN,"%f",$c);echo"MEDIA = ".number_format($a*0.2+$b*0.3+$c*0.5,1)."\n"; ?>

beecrowd 1006 v2

PHP
1 year ago
<?php fscanf(STDIN,"%f",$a);fscanf(STDIN,"%f",$b);fscanf(STDIN,"%f",$c);echo"MEDIA = ".number_format(($a*2+$b*3+$c*5)/10,1)."\n"; ?>

beecrowd 1006

PHP
1 year ago
<?php $a = (float)trim(fgets(STDIN)); $b = (float)trim(fgets(STDIN)); $c = (float)trim(fgets(STDIN)); $media = ($a*2 + $b*3 + $c*5) / 10; printf("MEDIA = %.1f\n", $media); ?>