Jesus and Satan have an argument as to who is the better programmer.
This goes on for a few hours until they agree to hold a contest with God
as the judge. They set themselves before their computers and begin. They
type furiously for several hours, lines of code streaming up the screen.
Seconds before the end of the competition a bolt of lightning strikes,
taking out the electricity. Moments later the power is restored and God
announces that the contest is over. He asks Satan to show what he has come
up with. Satan is visibly upset and cries I have nothing! I lost it all
when the power went out. Very well then says God let us see if Jesus fared
any better. Jesus enters a command and the screen comes to life in vivid
display the voices of an angelic choir pour forth from the speakers. Satan
is astonished. He stutters But how! I lost everything yet his program is
intact! How did he do it?! God chuckles Jesus saves!
SizeOf(nome)
retorne o tamanho da variável nome. Para mostrar o resultado, vamos usar WriteLn (aula 5).
WriteLn(SizeOf(nome));
1. Escreve um programa que
O resultado do writeln(r) do programa acima fica feio. Por exemplo:
real: 6.93896007838148E003
Imagina receber a informação do saldo da sua conta no
banco nesta forma!
Melhor seria
real: 6938.96
A instrução WriteLn
pode gerar texto com formato predefinido. veja aula teórica
6.
3. Escreve um programa com variavéis r,
s,
e i, de tipo real, string e longint. Atribue valores:
r =
63.9, s = o seu nome, e i = o numero do aluno. O programa
deve mostrar esses tres variáveis no formato s: 30 lugares,
i:
10 lugares, r: 10 lugares total e dois casos decimais depois o
ponto, por exemplo:
Peter Stallinga 999999 63.90
FullOfErrors;
begin
real: x,y,z;
CONST PI = 1.6857;
x := 3;
y = 2*pi;
1 := z;
writelnn(x:0:3);
end.