Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
program p5;
{calcularea numarului ramas in cutie dintre a,b,c,cunoscand valoarea lor}
var a,b,c,s:integer;
begin
writeln('introduceti valorile a,b,c:');
readln(a,b,c);
s:=a+b or b+c or c+a;
writeln('suma a doua numere scoase din cutie:');
readln(s);
if s=a+b then
writeln(c);
if s=b+c then
writeln(a);
if s=a+c then
writeln(b);
end.
program p4;
{introducerea in ordine crescatoare a valorilor}
var a,b,c:real;
begin
writeln('introduceti valorile a,b,c:');
readln(a,b,c);
writeln('valorile in ordine crescatoare');
if (a<b) and (a<c) and (b<c) then
writeln(a,' ',b,' ',c,' ');
if (a<b) and (a<c) and (c<b) then
writeln(a,' ',c,' ',b,' ');
if (b<a) and (b<c) and (a<c) then
writeln(b,' ',a,' ',c,' ');
if (b<a) and (b<c) and (c<a) then
writeln(b,' ',c,' ',a,' ');
if (c<a) and (c<b) and (a<b) then
writeln(c,' ',a,' ',b,' ');
if (c<a) and (c<b) and (b<a) then
writeln(c,' ',b,' ',a,' ');
end.
program chan_le;
uses crt;
var N: integer;
begin
write('Nhap N: ');
readln(N);
if (N mod 2 = 0) then writeln('N la so chan.');
else
if (N mod 2 = 1) then writeln('N la so le');
readln
end.
program kekthenewmeme;
var kilkist_ludei, rik, i: integer;
begin
i:=0;
kilkist_ludei:=100;
rik:=2000;
for i:=0 to 11 do
begin
kilkist_ludei:=kilkist_ludei*2;
writeln (i+2000,'=',kilkist_ludei);
end;
readln
end.
var
nome:string;
nome_do_produto:string;
quantidade:byte;
preço:integer;
total:Integer;
número_de_contribuinte:Real;
Deseja_introduzir_o_número_de_contribuinte:Char;
Begin
Writeln('Seja bem vindo/a Qual o seu nome?');
readln(nome);
Writeln('Qual o nome do produto que deseja?');
Readln(nome_do_produto);
writeln('Qual é a quantidade pretendida do mesmo?');
readln(quantidade);
writeln('qual o preço de cada unidade do seu produto?');
Readln(preço);
total:=preço*quantidade;
writeln('a sua compra custar-lhe.à:'total);
End.
Program calculatesquare;
Var
Number, Square: integer;
Begin
WriteLn('please enter two numbers=');
ReadLn(Number);
Square:=number*number;
WriteLn('the square of=',number, 'is=', square);
ReadLn;
End.
Program HW2;
type
HKID : record
firstChar : char;
sixInt : array[1..6] of integer;
veriStr : string;
end;
var
mang , ans: string;
sing : char;
sfz : HKID;
i : integer;
Begin
write('Enter your name : ');
readln(mang);
sing := '';
while ord(sing) <> (70 or 77 or 102 or 109) do
begin
write('Enter your sex : ');
readln(sing);
end;
write('Enter your HKID : ');
readln(sfz);
if (ord(mang[1]) < 65) and (ord(mang[i]) > 90) then
mang[1] := chr(ord(mang[1]) - 32);
for i := 2 to length(mang) do
begin
if ord(mang[i-1]) = 32 then
begin
if (ord(mang[i]) < 65) and (ord(mang[i]) > 90) then
mang[i] := chr(ord(mang[i]) - 32);
end;
else if (ord(mang[i-1]) > 65) and (ord(mang[i-1]) < 90) then
begin
if (ord(mang[i]) < 97) and (ord(mang[i]) > 122) then
mang[i] := chr(ord(mang[i]) + 32);
end;
end;
if (ord(sing) = 70) or (ord(sing) = 102) then
ans := 'Mr. ',mang
else
ans := 'Miss. ',mang
writeln(ans);
End.
Program Area(output);
var a,b,c,tx,x,y,z:integer;
begin
writeln('Choose The Graph For You To Print Area');
writeln('Square=1');
writeln('Rectangle=2');
writeln('Triangle=3');
writeln('Parallelogram=4');
writeln('Trapezoid=5');
read(z);
case z of
1: begin
writeln('x=');
read(x);
for a:=1 to x do
begin
writeln;
for b:=1 to x do
begin
write('[x]');
end;
end;
end;
2: begin
writeln('x=');
read(x);
writeln('y=');
read(y);
for a:=1 to y do
begin
writeln;
for b:=1 to x do
begin
write('[x]');
end;
end;
end;
3: begin
writeln('x=');
read(x);
for a:=1 to x do
begin
writeln;
for b:=1 to a do
begin
write('[x]');
end;
end;
end;
4: begin
writeln('x=');
read(x);
writeln('y=');
read(y);
for a:=1 to y do
begin
writeln;
for b:=1 to a do
write(' ');
for c:=1 to x do
write('[x]');
end;
end;
5: begin
writeln('tx=');
read(tx);
writeln('y=');
read(y);
if (tx=1) or (y=1) then
begin
writeln;
writeln('Input Error');
end
else
begin
x:=tx-1;
for a:=1 to y do
begin
writeln;
for b:=1 to a do
write('[x]');
for c:=1 to x do
write('[x]');
end;
end;
end;
else
writeln;
writeln('Input Error');
end;
end.