Вы находитесь на странице: 1из 4

i jan's im form indonesia,in elementary school.

could you help me ,,i have a problem with my home work,


in the exersice we command to make a program with the input and output.
the exersice say,
.............................................................
1) pola bilangan
format masukan
sebuah bilangan bulat N(0<N<10)
format keluaran
pola berukuran N ,seperti pada contoh keluaran.
contoh masukan 1
5
contoh keluaran 1
0
12
345
6789
01234
contoh masukan 2
7
contoh keluaran 2
0
12
345
6789
01234
567890
1234567
please help me to make this code,i very newbie,,i try so much but i can't create
the program;
and do you want to make code program matemathic for me to try,and my sience so c
an make me
better ,my friend called me stupid.
--sorry for my poor english--
................................................................................
.............
could anyone help me ;i'm newbie
i have a exersise,
it say
2)try to make this program
'Dua Pangkat'.
bilangan 2 pankat adalah bilangan bulat yang dapat di tuliskan dalam bentuk 2^K
di mana k
adalah sebuah bilangan bulat.
Format masukan 1
sebuah bilangan bulat dalam jankauan 1 sampai 2^20.
format keluaran 1
"true"jika bilangan yang di berikan adalah 2 pangkat dan"false" jika sebaliknya.
contoh masukan 1
8
contoh keluaran 1
TRUE
contoh masukan 2
6
contoh keluaran 2
FALSE
so help me anything you can do,
--------------------------------------------------------------------------------
------------
can anyone help me;i confused with this simple program
i try to call the function with number <=100 but i can't understan this program
can anyone help me to detailing and do it manual without pascalaplication;

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

Вам также может понравиться