This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program discriminante | |
real a, b, c, delta | |
print*, 'Programa de calculo do Discriminante' | |
print*, 'a=' | |
read*, a | |
print*, 'b=' | |
read*, b | |
print*, 'c=' | |
read*, c | |
if (a .ne. 0) then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program meuprog | |
integer x1 | |
x1 = 2 + 3 | |
if ( x1 .GT. 5) then | |
print*, 'maior que 5' | |
else | |
print*,'x1=', x1 | |
end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET time_zone = '-3:00'; #Resultados em horário normal. | |
SELECT #TIMESTAMP, | |
'311' as COD, | |
YEAR(Timestamp) as Ano, | |
dayofyear(Timestamp) as DJ, | |
#HOUR(Timestamp) as Hora, | |
#MINUTE(Timestamp) as Minuto, | |
Concat( | |
HOUR(timestamp), | |
CASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program gases_ideais | |
implicit none | |
real :: T,P,N,VOLUME | |
real :: le_valor, gas_ideal | |
T = le_valor('o valor da temperatura'); | |
P = le_valor('o valor da pressão'); | |
N = le_valor('o numero de mols'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program estatistica | |
! Programa que pede 5 notas e calcula a media, dispersao, | |
! variancia e o desvio padrao | |
! Criando variaveis | |
integer :: i, total_notas = 5 | |
real :: nota = 0.0, somatorio_notas=0.0, nota_media=0.0 | |
! Criando um contador para as notas usadio a estrutura | |
! de repeticao do end do | |
! 9 5 7 3 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program binario | |
integer, parameter :: bits = 8 | |
character(bits) :: num_binario = '00101010' | |
integer*1 :: bit | |
integer :: inf, sup | |
read(num_binario(1:1),'(I1)') bit | |
num_decimal = -2.0**(bits-1) * bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program homework_01_2 | |
implicit none | |
real, parameter :: so = 1367.0 ! fluxo médio anual da energia solar incidente sobre o planeta Terra | |
real, parameter :: alfa = 0.3 ! média do albedo | |
real, parameter :: sigma = 5.57e8 ! W m^-2 K^-4 - constante de Stefan-Boltzmann | |
real :: temperatura_emissividade, temperatura_emissividade1,temperatura_emissividade2 | |
temperatura_emissividade = ( so * ( (1.0 - alfa) / (4.0 * sigma) ) )**0.25 | |
temperatura_emissividade1 = ( so * 0.3 * ( (1.0 - alfa) / (4.0 * sigma) ) )**0.25 | |
temperatura_emissividade2 = ( so * ( (1.0 - ( alfa + alfa * 0.3 )) / (4.0 * sigma) ) )**0.25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program homework_01_1 | |
implicit none | |
real, parameter :: mu = 1.0, rho_s = 1.0, rho_f = 0.5 | |
real :: delta_p, diametro, velocidade | |
integer :: i | |
integer*2 :: val_i, val_f | |
val_i = 50; val_f = 1000 | |
delta_p = (val_f - val_i) / 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program matriz_3x3 | |
! Matriz | |
! | |
! | 3 -7 4 | | a11 a12 a13 | | A(1,1) A(1,2) A(1,3) | | |
! A = | 0 1 5 | = | a21 a22 a23 | = | A(2,1) A(2,2) A(2,3) | | |
! | 4 2 2 | | a31 a32 a33 | | A(3,1) A(3,2) A(3,3) | | |
! | |
integer A(3,3) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program fatorial | |
implicit none | |
! define variaveis | |
integer :: nfact = 1 | |
integer(kind=1) :: n | |
! calculando o fatorial | |
print*,' n | FATORIAL' | |
print*,'========================' |