Академический Документы
Профессиональный Документы
Культура Документы
function g(j:integer):integer;
begin
if j<=100 then
g:=g(g(j+11))
else
g:=j-10;
end;
begin
g(41);
readln;
end.
and this program, the var you can add with your mind
begin
asd:='asdfghjklmnbvcxz';
zx:=1;
cv:=length(asd);
while zx<>asd[cv] then
begin
asd[zx]:=asd[cv];
fgh:=asd[zx];
asd[cv]:=fgh;
end;
zx:=zx+1;
cv:=cv-1;
end;
writeln(asd);
end.
can you teach me manually with this program
Var
J:Integer;
N:Integer;
Begin
WriteLn('Please select the number of rows?');
Readln(N); {Obviously this code gets in input now for the output...'}
For J := 1 to N do {Our row handler}
Begin
For K := 1 to J do {our column handler}
Begin
Write(K);
End;
Writeln;
End;
Readln;
End.
VAR a,b:5..100000000;
i:1..100000000;
pio:text;
flag:boolean;
j:1..10000;
s:string[9];
BEGIN
assign(pio,'pprime.in');
reset(pio);
read(pio,a,b);
close(pio);
assign(pio,'pprime.out');
rewrite(pio);
FOR i:=a TO b DO
BEGIN
flag:=true;
s:='';
str(i,s);
FOR j:=1 TO trunc(length(s)/2) DO IF s[j]<>s[length(s)-j+1] THEN
BEGIN
flag:=false;
break;
IF flag=true THEN
FOR j:=2 TO trunc(sqrt(i)) DO IF frac(i/j)=0 THEN
BEGIN
flag:=false;
break;
END;
IF flag=true THEN writeln(pio,i);
END;
close(pio);
END.
-------------------------------------------------------------------------------
-
Var
J,K,M,Start,Len :Integer
Begin
Writeln('Enter the starting position [0-8] ?');
Readln(Start);
Writeln('Enter the length of the pyramid [1-9] ?');
Readln(Leng);
If Leng > start then
Begin
M :=-1;
For J := Start to Leng do
Begin
For K := start to J do
Begin
M :=M+1;
If M > 9 then M = 0;
Write(M);
End;
Writeln;
End;
end else Writeln(Start,':',Leng,' start can not be bigger than the length!!');
Readln;
End.
Input: 0;9
Output:
0
12
345
6789
01234
567890
1234567
89012345
678901234